/* Voice Helper — спокойный современный UI (без кислотных градиентов)
   Примечание: палитра slate + мягкий teal; шрифты Fraunces + Figtree */

:root {
  --bg-deep: #e8ebe6;
  --bg-mid: #f3f1ec;
  --bg-surface: #faf9f6;
  --ink: #1c2421;
  --ink-soft: #4a5550;
  --ink-muted: #6b756f;
  --line: rgba(28, 36, 33, 0.12);
  --accent: #2f5d50;
  --accent-hover: #244a40;
  --accent-soft: rgba(47, 93, 80, 0.1);
  --accent-ring: rgba(47, 93, 80, 0.28);
  --danger: #8b3a3a;
  --danger-bg: #f5e8e6;
  --ok: #2f5d50;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --shadow-soft: 0 1px 0 rgba(28, 36, 33, 0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(47, 93, 80, 0.09), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(120, 100, 70, 0.08), transparent 50%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg-mid) 45%, #eceae4 100%);
  background-attachment: fixed;
}

/* --- Layout --- */

.page {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
}

.hero {
  padding: 1.25rem 0 2rem;
  animation: rise-in 0.7s var(--ease) both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 0.85rem;
}

.brand span {
  color: var(--accent);
}

.hero-lead {
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
}

.hero-meta {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* --- Upload zone (единственная интерактивная «поверхность») --- */

.upload-zone {
  margin-top: 1.75rem;
  padding: 2.25rem 1.5rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(6px);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.35s var(--ease),
    background 0.35s var(--ease),
    transform 0.35s var(--ease);
  animation: rise-in 0.75s var(--ease) 0.08s both;
}

.upload-zone:hover,
.upload-zone:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--bg-surface);
}

.upload-zone.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

.upload-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.1rem;
  color: var(--accent);
  opacity: 0.9;
}

.upload-mark svg {
  width: 100%;
  height: 100%;
}

.upload-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.upload-hint {
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 28rem;
  margin: 0 auto 1.35rem;
  line-height: 1.45;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* --- Buttons --- */

.btn {
  appearance: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #f7f6f2;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.btn-ghost.success {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: var(--accent-soft);
}

.btn-ghost.error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--danger-bg);
}

.btn-ghost:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* --- Progress --- */

.progress-wrap {
  display: none;
  margin-top: 1.5rem;
  animation: rise-in 0.4s var(--ease) both;
}

.progress-track {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.progress-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.7rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* --- Results --- */

.results {
  display: none;
  margin-top: 2rem;
  animation: rise-in 0.55s var(--ease) both;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
  padding: 0.9rem 0 1.35rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.meta-row strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.panel {
  padding: 1.35rem 0 0.4rem;
  border-bottom: 1px solid var(--line);
}

.panel:last-child {
  border-bottom: none;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 520;
  letter-spacing: -0.02em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.panel-body {
  color: var(--ink-soft);
  white-space: pre-wrap;
  max-height: 22rem;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.65;
}

.panel-body::-webkit-scrollbar {
  width: 8px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 4px;
}

/* --- Messages --- */

.flash {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  animation: rise-in 0.35s var(--ease) both;
}

.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

.flash-ok {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* --- Footer --- */

.site-footer {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.85rem;
  animation: rise-in 0.8s var(--ease) 0.12s both;
}

.footer-product {
  margin-bottom: 0.45rem;
}

.footer-dev a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.footer-dev a:hover {
  color: var(--accent-hover);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* --- Motion --- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 1.25rem, 920px);
    padding-top: 1.5rem;
  }

  .upload-zone {
    padding: 1.75rem 1rem;
  }

  .panel-head {
    align-items: flex-start;
  }
}
