:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #1d1c1a;
  --muted: #6b6862;
  --border: #e2dfd8;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9df;
  --ok: #15803d;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --live: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans SC", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1d1c1a;
    --surface-2: #262522;
    --text: #f1efea;
    --muted: #a19d95;
    --border: #34322e;
    --accent: #fb923c;
    --accent-ink: #1b0e05;
    --accent-soft: #3a2415;
    --ok: #4ade80;
    --danger: #f87171;
    --danger-soft: #3b1a1a;
    --live: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a:not(.btn) { color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 15px; }
.nav a:not(.btn):hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 600 15px var(--font); cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--muted); padding: 8px 10px; font: 15px var(--font); cursor: pointer; }
.btn-link:hover { color: var(--text); }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], select {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 16px var(--font);
}
input:focus, select:focus, .btn:focus-visible, .chip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--accent-soft); color: var(--text); }

/* auth cards */
.auth { display: grid; place-items: center; padding: 48px 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.auth .card { width: 100%; max-width: 420px; }
.card h1 { font-size: 24px; margin: 0 0 6px; }
.card .sub { color: var(--muted); margin: 0 0 22px; }
.card .btn { width: 100%; }
.card .alt { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }

/* landing */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 12px 0 18px; letter-spacing: -.02em; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.demo { padding: 20px; }
.demo-line { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.demo-line:last-child { margin-bottom: 0; }
.demo-line .tag { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.demo-line .txt { font-size: 18px; margin-top: 2px; }
.demo-line.src { background: var(--accent-soft); }
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 28px; margin: 0 0 8px; letter-spacing: -.01em; }
.section .sub { color: var(--muted); margin: 0 0 32px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 22px; }
.feature .num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); }
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 14px; }

/* translator app */
.app-shell { padding: 28px 0 48px; }
.controls { display: grid; grid-template-columns: 1fr 2fr auto; gap: 20px; align-items: start; }
.controls .mic-btn { align-self: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 14px; cursor: pointer; user-select: none;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; }
.options { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 14px; }
.options label { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; cursor: pointer; }
.mic-btn { min-width: 170px; }
.mic-btn.live { background: var(--live); border-color: var(--live); color: #fff; }
.status-bar { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: 14px; min-height: 24px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; }
.dot.on { background: var(--ok); }
.dot.speech { background: var(--live); box-shadow: 0 0 0 5px color-mix(in srgb, var(--live) 25%, transparent); }
.meter { width: 120px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s linear; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.utt { padding: 18px 20px; }
.utt .src { font-size: 17px; margin-bottom: 10px; }
.utt .tr { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.utt .tr b { color: var(--accent); font-size: 13px; text-transform: uppercase; padding-top: 3px; }
.utt .tr div { font-size: 19px; }
.utt .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; border: 1px dashed var(--border); border-radius: var(--radius); }

@media (max-width: 860px) {
  .hero-grid, .grid3 { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
  .mic-btn { width: 100%; }
  .hero { padding: 40px 0; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .nav a:not(.btn) { padding: 8px 6px; }
  .card { padding: 22px; }
}
.stack { width: 100%; max-width: 420px; }
.mb { margin-bottom: 18px; }
.card h1.h-sm { font-size: 20px; }
.hint.inline { display: inline; font-weight: 400; margin-left: 4px; }
[hidden] { display: none !important; }
.stack.wide { max-width: 560px; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card .btn-row .btn { width: auto; flex: 1; }
.card .btn-row .btn-link { flex: none; }
.help { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.help h2 { font-size: 16px; margin: 0 0 10px; }
.help details { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; background: var(--surface-2); }
.help details[open] { background: var(--surface); }
.help summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.help ol { margin: 10px 0 4px; padding-left: 20px; font-size: 14px; }
.help li { margin-bottom: 6px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 18px; font-size: 15px; }
.engine-row { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: end; margin-top: 18px; }
.engine-row .hint { margin: 0 0 12px; }
@media (max-width: 860px) { .engine-row { grid-template-columns: 1fr; gap: 6px; } .engine-row .hint { margin: 0; } }
