/* ==========================================================================
   LinguaFlow — Design System
   Glassmorphism · Rounded · Fluid · Dark/Light Theme
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed-fast: 160ms;
  --speed-med: 320ms;
  --speed-slow: 640ms;

  /* Light theme */
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --text: #101322;
  --text-soft: #5b6178;
  --text-faint: #8a90a6;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 24px 60px -18px rgba(31, 38, 88, 0.25);
  --card-bg: rgba(255, 255, 255, 0.66);
  --input-bg: rgba(255, 255, 255, 0.6);
  --input-border: rgba(16, 19, 34, 0.08);
  --hover-bg: rgba(16, 19, 34, 0.05);
  --brand-1: #6366f1;
  --brand-2: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --code-bg: rgba(99, 102, 241, 0.08);
  --scrollbar: rgba(16, 19, 34, 0.18);
}

[data-theme="dark"] {
  --bg: #08080f;
  --bg-2: #101018;
  --text: #f1f2fa;
  --text-soft: #9aa0b9;
  --text-faint: #666c85;
  --glass-bg: rgba(24, 25, 38, 0.6);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  --card-bg: rgba(28, 29, 44, 0.62);
  --input-bg: rgba(20, 21, 34, 0.7);
  --input-border: rgba(255, 255, 255, 0.08);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --code-bg: rgba(139, 92, 246, 0.14);
  --scrollbar: rgba(255, 255, 255, 0.16);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--speed-med) var(--ease), color var(--speed-med) var(--ease);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
textarea, input { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(99, 102, 241, 0.35); }

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: var(--radius-pill); }

/* ---------- Ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.5; transition: opacity var(--speed-slow) var(--ease); }
.glow--a { width: 620px; height: 620px; top: -240px; left: -140px; background: radial-gradient(circle, rgba(99,102,241,0.55), transparent 65%); }
.glow--b { width: 560px; height: 560px; top: 8%; right: -180px; background: radial-gradient(circle, rgba(236,72,153,0.45), transparent 65%); }
.glow--c { width: 520px; height: 520px; bottom: -220px; left: 32%; background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 65%); }
[data-theme="dark"] .glow { opacity: 0.62; }

/* ---------- Glass primitive ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--glass-shadow);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 42px);
  margin: 12px clamp(12px, 2.5vw, 26px);
  border-radius: var(--radius-lg);
  transition: background var(--speed-med) var(--ease);
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand__mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--accent));
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.7);
}
.brand__text span { background: linear-gradient(90deg, var(--brand-1), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.site-nav { display: flex; }
.nav-list { display: flex; list-style: none; gap: 6px; padding: 5px; border-radius: var(--radius-pill); background: rgba(127, 127, 152, 0.08); }
.nav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  transition: all var(--speed-fast) var(--ease); white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--hover-bg); }
.nav-link.is-active { color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.8); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); color: var(--text-soft);
  background: var(--hover-bg); transition: all var(--speed-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); transform: translateY(-1px); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

.status-pill {
  display: none; /* hidden in the header — health status kept for internal use only */
  align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--input-border); background: var(--hover-bg);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
.status-pill.is-online .status-dot { background: var(--success); animation: pulse 2.2s infinite; }
.status-pill.is-offline .status-dot { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* ---------- Main layout ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 26px clamp(16px, 3.5vw, 38px) 60px; }

.tab-panel { display: none; animation: fadeUp var(--speed-med) var(--ease); }
.tab-panel.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.tab-hero { text-align: center; margin: 6px 0 30px; }
.hero-title { font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.gradient-text { background: linear-gradient(90deg, var(--brand-1), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-soft); margin-top: 8px; font-size: 15.5px; }

/* ==========================================================================
   Marketing sections — hero, why choose, how it works, use cases, FAQ, CTA
   ========================================================================== */

/* ---------- Marketing hero ---------- */
.marketing-hero { text-align: center; padding: 46px 0 30px; }
.hero-title--lg { font-size: clamp(32px, 5.5vw, 54px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; }
.hero-lead { max-width: 720px; margin: 18px auto 0; color: var(--text-soft); font-size: 16.5px; }
.hero-lead--sm { max-width: 640px; font-size: 14.5px; margin-top: 10px; }

.hero-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 20px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 700;
  color: var(--brand-1); background: var(--code-bg); border: 1px solid rgba(99, 102, 241, 0.18);
  transition: all var(--speed-fast) var(--ease);
}
.hero-pill:hover { color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border-color: transparent; transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.8); }

.hero-drop {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 620px; margin: 30px auto 0; padding: 40px 26px; border-radius: var(--radius-lg);
  border: 2px dashed var(--brand-1); background: var(--input-bg); color: var(--brand-1);
  cursor: pointer; transition: all var(--speed-med) var(--ease);
}
.hero-drop:hover { background: var(--code-bg); transform: translateY(-2px); box-shadow: 0 16px 40px -16px rgba(99, 102, 241, 0.5); }
.hero-drop__title { font-size: 15px; font-weight: 700; color: var(--text); }

.hero-support { margin-top: 12px; font-size: 12.5px; color: var(--text-faint); }

.hero-trust { display: flex; justify-content: center; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 30px; }
#why .hero-trust { margin-top: 0; margin-bottom: 40px; }
.hero-trust__item { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.hero-trust__item svg { color: var(--success); }

/* ---------- Marketing sections ---------- */
.marketing-section { margin-top: 96px; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.section-kicker { font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-1); }
.section-title { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.03em; margin-top: 10px; }
.section-sub { color: var(--text-soft); margin-top: 12px; font-size: 15.5px; }

/* ---------- Feature cards (Why Choose) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 26px; border-radius: var(--radius-lg); transition: transform var(--speed-med) var(--ease), box-shadow var(--speed-med) var(--ease); }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 28px 60px -20px rgba(31, 38, 88, 0.35); }
.feature-card__icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 24px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, 0.7);
}
.feature-card h3 { font-size: 17px; font-weight: 800; margin-top: 18px; letter-spacing: -0.01em; }
.feature-card p { color: var(--text-soft); font-size: 14px; margin-top: 9px; line-height: 1.7; }

/* ---------- Steps (How It Works) ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step-card { padding: 26px; border-radius: var(--radius-lg); text-align: center; position: relative; transition: transform var(--speed-med) var(--ease); }
.step-card:hover { transform: translateY(-4px); }
.step-card__num {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  font-size: 20px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--accent));
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, 0.7);
}
.step-card h3 { font-size: 16px; font-weight: 800; margin-top: 18px; letter-spacing: -0.01em; }
.step-card p { color: var(--text-soft); font-size: 13.5px; margin-top: 9px; line-height: 1.7; }

/* ---------- Use cases ---------- */
.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.case-card { padding: 28px; border-radius: var(--radius-lg); display: flex; gap: 20px; align-items: flex-start; transition: transform var(--speed-med) var(--ease), box-shadow var(--speed-med) var(--ease); }
.case-card:hover { transform: translateY(-4px); box-shadow: 0 28px 60px -20px rgba(31, 38, 88, 0.35); }
.case-card__icon {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font-size: 25px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-2), var(--accent));
  box-shadow: 0 10px 22px -8px rgba(139, 92, 246, 0.6);
}
.case-card h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.case-card p { color: var(--text-soft); font-size: 14px; margin-top: 8px; line-height: 1.7; }

/* ---------- FAQ ---------- */
.faq-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 820px; margin: 0 auto 22px; }
.faq-tab {
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-size: 14.5px; font-weight: 700; color: var(--text-soft);
  background: var(--card-bg); border: 1px solid var(--input-border);
  cursor: pointer; transition: all var(--speed-fast) var(--ease);
}
.faq-tab:hover { color: var(--text); border-color: var(--brand-1); }
.faq-tab.is-active {
  color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border-color: transparent; box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.6);
}
.faq-panel { display: none; }
.faq-panel.is-active { display: grid; gap: 10px; }
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--card-bg); overflow: hidden; transition: border-color var(--speed-fast) var(--ease); }
.faq-item[open] { border-color: var(--brand-1); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 17px 22px; font-size: 15px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: color var(--speed-fast) var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 20px; font-weight: 600; color: var(--brand-1); line-height: 1;
  transition: transform var(--speed-med) var(--ease); flex-shrink: 0;
}
.faq-item[open] summary { border-bottom: 1px solid var(--input-border); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 15px 22px 20px; color: var(--text-soft); font-size: 14.5px; line-height: 1.75; }

/* ---------- Final CTA ---------- */
.cta-section {
  margin-top: 96px; padding: 64px 30px; text-align: center; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; box-shadow: 0 30px 70px -22px rgba(99, 102, 241, 0.7);
}
.cta-title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.cta-sub { max-width: 640px; margin: 14px auto 0; font-size: 15.5px; opacity: 0.92; }
.cta-sub--sm { font-size: 14px; opacity: 0.82; margin-top: 8px; }
.btn--cta {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 9px;
  padding: 16px 34px; border-radius: var(--radius-pill); font-size: 15.5px; font-weight: 800;
  color: var(--brand-1); background: #fff; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.35);
  transition: all var(--speed-med) var(--ease);
}
.btn--cta:hover { transform: translateY(-2px) scale(1.02); color: var(--brand-2); }

/* ---------- Text translator card ---------- */
.translator-card { border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 30px); }

.lang-sel { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.lang-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  transition: all var(--speed-fast) var(--ease);
}
.lang-chip:hover { border-color: var(--brand-1); }
.lang-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 17px; line-height: 1; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 6px 14px -6px rgba(99, 102, 241, 0.6);
}

.lang-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; min-height: 26px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.badge--auto { color: var(--brand-1); background: var(--code-bg); }
.badge--ok { color: var(--success); background: rgba(16, 185, 129, 0.12); }
.badge--live { color: var(--accent); background: rgba(236, 72, 153, 0.12); }

.char-count { font-size: 12.5px; font-weight: 600; color: var(--text-faint); }
.char-count.is-full { color: var(--danger); }

.text-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.pane { position: relative; }
.pane__input {
  width: 100%; min-height: 260px; resize: vertical;
  padding: 18px 18px 42px; border-radius: var(--radius-md);
  font-size: 15.5px; line-height: 1.7; background: var(--input-bg);
  border: 1px solid var(--input-border); outline: none;
  transition: border-color var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.pane__input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }

.pane--out { background: var(--card-bg); border: 1px solid var(--input-border); border-radius: var(--radius-md); }
.pane__output {
  min-height: 260px; padding: 18px; font-size: 15.5px; line-height: 1.7;
  outline: none; overflow-y: auto;
}
.pane__output:empty::before { content: attr(data-placeholder); color: var(--text-faint); pointer-events: none; }

.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.action-group { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; color: var(--text-soft);
  background: var(--input-bg); border: 1px solid var(--input-border);
  transition: all var(--speed-fast) var(--ease);
}
.btn:hover { color: var(--text); border-color: var(--brand-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn--primary {
  color: #fff; border: none;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.75);
}
.btn--primary:hover { color: #fff; filter: brightness(1.08); box-shadow: 0 14px 30px -8px rgba(99, 102, 241, 0.85); }

.btn--start { background: linear-gradient(135deg, var(--success), #059669); color: #fff; border: none; padding: 14px 28px; font-size: 15px; box-shadow: 0 10px 24px -8px rgba(16, 185, 129, 0.7); }
.btn--start:hover { color: #fff; filter: brightness(1.07); }
.btn--stop { background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; border: none; padding: 14px 28px; font-size: 15px; box-shadow: 0 10px 24px -8px rgba(239, 68, 68, 0.7); }
.btn--stop:hover { color: #fff; filter: brightness(1.07); }

.loading-dots { display: inline-flex; gap: 5px; align-items: center; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-1); animation: bounce 1.2s infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-7px); opacity: 1; } }
.is-hidden { display: none !important; }

/* ---------- Upload page ---------- */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.upload-card, .result-card { border-radius: var(--radius-lg); padding: 26px; }

.drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 54px 26px; border-radius: var(--radius-md); text-align: center;
  border: 2px dashed var(--input-border); background: var(--input-bg);
  transition: all var(--speed-med) var(--ease); min-height: 420px; justify-content: center;
}
.drop-zone:hover { border-color: var(--brand-1); }
.drop-zone.is-dragover { border-color: var(--brand-1); background: var(--code-bg); transform: scale(1.015); }
.drop-zone__icon { color: var(--brand-1); display: grid; place-items: center; width: 78px; height: 78px; border-radius: 22px; background: var(--code-bg); }
.drop-zone__title { font-size: 19px; font-weight: 700; }
.drop-zone__hint { color: var(--text-soft); font-size: 14px; }

.format-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 4px 0 2px; }
.fmt-chip { padding: 5px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-soft); background: var(--hover-bg); border: 1px solid var(--input-border); }
.drop-zone__limit { font-size: 12px; color: var(--text-faint); }

.btn--browse { margin-top: 4px; }

.upload-progress { padding: 10px 6px; }
.file-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.file-item__name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { color: var(--text-faint); font-size: 13px; }

.progress-track { height: 10px; border-radius: var(--radius-pill); background: var(--hover-bg); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand-1), var(--accent)); width: 0%; transition: width 0.35s var(--ease); }
.progress-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text-soft); }

/* Wave animation */
.wave-anim { display: flex; align-items: center; justify-content: center; gap: 5px; height: 46px; margin-top: 16px; }
.wave-anim span { width: 5px; height: 14px; border-radius: 4px; background: linear-gradient(180deg, var(--brand-1), var(--accent)); animation: wave 1.1s ease-in-out infinite; }
.wave-anim span:nth-child(1) { animation-delay: 0s; } .wave-anim span:nth-child(2) { animation-delay: 0.1s; }
.wave-anim span:nth-child(3) { animation-delay: 0.2s; } .wave-anim span:nth-child(4) { animation-delay: 0.3s; }
.wave-anim span:nth-child(5) { animation-delay: 0.4s; } .wave-anim span:nth-child(6) { animation-delay: 0.5s; }
.wave-anim span:nth-child(7) { animation-delay: 0.6s; } .wave-anim span:nth-child(8) { animation-delay: 0.7s; }
.wave-anim span:nth-child(9) { animation-delay: 0.8s; } .wave-anim span:nth-child(10) { animation-delay: 0.9s; }
.wave-anim span:nth-child(11) { animation-delay: 1s; } .wave-anim span:nth-child(12) { animation-delay: 1.1s; }
.wave-anim span:nth-child(13) { animation-delay: 1.2s; } .wave-anim span:nth-child(14) { animation-delay: 1.3s; }
.wave-anim span:nth-child(15) { animation-delay: 1.4s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); height: 12px; } 50% { transform: scaleY(1); height: 42px; } }

/* Results */
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 420px; text-align: center; color: var(--text-faint); padding: 20px; }
.result-empty svg { opacity: 0.4; }
.result-empty p { font-size: 14.5px; }

.result-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.result-doc { display: grid; gap: 14px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.result-block { border: 1px solid var(--input-border); border-radius: var(--radius-md); overflow: hidden; background: var(--card-bg); }
.result-block__head { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; border-bottom: 1px solid var(--input-border); background: var(--hover-bg); }
.result-block__head h4 { font-size: 13.5px; font-weight: 700; }
.result-block__body { padding: 15px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }

.mini-btn { font-size: 12px; font-weight: 700; color: var(--brand-1); padding: 4px 10px; border-radius: var(--radius-pill); background: var(--code-bg); transition: all var(--speed-fast) var(--ease); }
.mini-btn:hover { background: rgba(99, 102, 241, 0.22); }

.result-block--segments { margin-top: 16px; }
.segment-list { display: grid; gap: 8px; padding: 12px; max-height: 240px; overflow-y: auto; }
.segment-item { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--hover-bg); }
.segment-item__time { font-size: 11.5px; font-weight: 700; color: var(--brand-1); font-variant-numeric: tabular-nums; }
.segment-item__text { font-size: 13.5px; }
.segment-item__text small { display: block; color: var(--text-faint); margin-top: 3px; }

.result-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- YouTube page ---------- */
.yt-form { display: flex; flex-direction: column; gap: 14px; justify-content: center; min-height: 420px; }
.yt-form__label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.4px; color: var(--text-soft); text-transform: uppercase; }
.yt-input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-md);
  font-size: 15px; background: var(--input-bg);
  border: 1px solid var(--input-border); outline: none;
  transition: border-color var(--speed-fast) var(--ease), box-shadow var(--speed-fast) var(--ease);
}
.yt-input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
.yt-form__hint { font-size: 12px; color: var(--text-faint); line-height: 1.55; }
.btn--block { width: 100%; }
.yt-title { max-width: 72%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-muted { opacity: 0.5; pointer-events: none; }

/* ---------- Live translator ---------- */
.live-mode-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 26px; }
.live-mode-tab {
  padding: 11px 22px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 700;
  color: var(--text-soft); background: var(--hover-bg); border: 1px solid var(--input-border);
  transition: all var(--speed-fast) var(--ease);
}
.live-mode-tab:hover { color: var(--text); }
.live-mode-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.8); }

.live-layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 22px; align-items: start; }

.record-card { border-radius: var(--radius-lg); padding: 38px 26px 26px; text-align: center; }
.record-card__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.mic-ring { position: relative; width: 128px; height: 128px; display: grid; place-items: center; }
.mic-ring__halo { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(135deg, var(--brand-1), var(--accent)); opacity: 0.18; transition: all var(--speed-med) var(--ease); }
.mic-btn {
  position: relative; z-index: 1; display: grid; place-items: center; width: 96px; height: 96px;
  border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 16px 34px -10px rgba(99, 102, 241, 0.75); transition: all var(--speed-med) var(--ease);
}
.mic-btn:hover { transform: scale(1.05); }

.record-card.is-recording .mic-ring__halo { opacity: 0.35; animation: ring 1.6s ease-out infinite; }
.record-card.is-recording .mic-btn { background: linear-gradient(135deg, var(--danger), #dc2626); box-shadow: 0 16px 34px -10px rgba(239, 68, 68, 0.8); }
@keyframes ring { 0% { transform: scale(1); opacity: 0.45; } 100% { transform: scale(1.55); opacity: 0; } }

.record-instruction { color: var(--text-soft); font-size: 14px; max-width: 260px; }

.record-controls { display: flex; gap: 12px; }

.record-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rec-timer { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.wave-anim--live { margin-top: 4px; height: 34px; }
.wave-anim--live span { background: linear-gradient(180deg, var(--success), #059669); }

.status-rows { width: 100%; display: grid; gap: 8px; text-align: left; }
.status-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--hover-bg); font-size: 13px; font-weight: 600; color: var(--text-soft); }
.status-row__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }
.status-row__val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.status-row.is-ok .status-row__dot { background: var(--success); }
.status-row.is-err .status-row__dot { background: var(--danger); }
.status-row.is-live .status-row__dot { background: var(--danger); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.live-results { display: grid; gap: 16px; }
.live-pane { border-radius: var(--radius-lg); overflow: hidden; }
.live-pane__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--input-border); background: var(--hover-bg); }
.live-pane__head h4 { font-size: 14px; font-weight: 700; }
.live-pill { padding: 4px 11px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; color: var(--text-soft); background: var(--card-bg); border: 1px solid var(--input-border); }
.live-pill--accent { color: var(--text-faint); }
.live-pill--accent[data-state="live"] { color: var(--danger); background: rgba(239, 68, 68, 0.12); }
.live-pill--accent[data-state="idle"] { color: var(--text-faint); }
.live-pane__body { padding: 18px; min-height: 148px; font-size: 15px; line-height: 1.8; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.placeholder { color: var(--text-faint); }
.live-word { display: inline-block; padding: 2px 4px; border-radius: 6px; animation: pop var(--speed-fast) var(--ease); background: var(--code-bg); margin: 1px 0; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  z-index: 300; padding: 13px 20px; border-radius: var(--radius-md);
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: all var(--speed-med) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: var(--danger); color: #fff; }
.toast--ok { background: var(--success); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 40px 20px 46px; color: var(--text-faint); font-size: 13px; border-top: 1px solid var(--input-border); margin-top: 60px; }
.footer-brand { font-size: 18px; font-weight: 800; color: var(--text); }
.footer-brand span { background: linear-gradient(90deg, var(--brand-1), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-tagline { max-width: 460px; margin: 8px auto 0; line-height: 1.7; }
.footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 20px; }
.footer-links a { font-weight: 600; color: var(--text-soft); transition: color var(--speed-fast) var(--ease); }
.footer-links a:hover { color: var(--brand-1); }
.footer-copy { margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .text-panes, .upload-layout, .live-layout { grid-template-columns: 1fr; }
  .site-nav { order: 3; width: 100%; justify-content: center; }
  .site-header { flex-wrap: wrap; }
  .nav-list { width: 100%; justify-content: center; overflow-x: auto; }
  .hero-title { font-size: 30px; }
  .feature-grid, .steps-grid { grid-template-columns: 1fr 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .header-actions .status-pill { display: none; }
  .action-bar { justify-content: center; }
  .action-group { flex-wrap: wrap; justify-content: center; }
  .btn { flex: 1 1 auto; }
  .record-card { padding: 30px 18px 20px; }
  .feature-grid, .steps-grid { grid-template-columns: 1fr; }
  .case-card { flex-direction: column; }
  .hero-trust { gap: 14px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Language switcher ---------- */
.lang-switcher { position: relative; }
.lang-switcher__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--input-border); background: var(--hover-bg);
  cursor: pointer; transition: all var(--speed-fast) var(--ease);
}
.lang-switcher__btn:hover { color: var(--text); transform: translateY(-1px); }
.lang-switcher__btn svg { transition: transform var(--speed-fast) var(--ease); }
.lang-switcher.is-open .lang-switcher__btn svg { transform: rotate(180deg); }
.lang-switcher__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  min-width: 150px; padding: 6px; list-style: none;
  border-radius: var(--radius-md);
  background: var(--card-bg); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all var(--speed-fast) var(--ease);
}
.lang-switcher.is-open .lang-switcher__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switcher__item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  background: transparent; border: none; cursor: pointer; text-align: left;
  transition: all var(--speed-fast) var(--ease);
}
.lang-switcher__item:hover { color: var(--text); background: var(--hover-bg); }
.lang-switcher__item.is-active { color: var(--brand-1); background: var(--code-bg); }

@media (max-width: 560px) {
  .lang-switcher__btn span:last-of-type { display: none; }
}