@font-face {
  font-family: Manrope;
  src: url('/static/manrope.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Manrope;
  src: url('/static/manrope-ext.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02D0-02D1,U+02DE-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: Vazirmatn;
  src: url('/static/vazirmatn.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Manrope, system-ui, sans-serif;
  color: #1d3028;
  background: #f5f5ed;
  font-weight: 600;
  --soft: #606e63;
  --line: #e1e4d9;
  --forest: #19382c;
  --mint: #d5efa9;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid #4a8b68;
  outline-offset: 4px;
}
h1, h2, p { margin: 0; }
.wrap { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #e3e5da; }
.topbar { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.header-controls { display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.055em; }
.brand-mark {
  width: 33px; height: 33px; background: #1e422f; color: var(--mint); border-radius: 10px;
  display: flex; justify-content: center; align-items: center; gap: 2px;
}
.brand-mark i { height: 9px; width: 2px; background: currentColor; border-radius: 5px; }
.brand-mark i:first-child, .brand-mark i:last-child { height: 5px; }
.brand-mark i:nth-child(3) { height: 15px; }
.engine-status { display: flex; align-items: center; gap: 8px; color: #43584b; font-size: 12px; font-weight: 750; }
.engine-status i, .studio-dot { width: 7px; height: 7px; background: #b69a4b; border-radius: 50%; }
.engine-status[data-status="ready"] i { background: #528768; box-shadow: 0 0 0 3px #e3ecdf; }
.engine-status[data-status="error"] i, .engine-status[data-status="disconnected"] i { background: #a34b3e; }

.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 58px 0 34px; }
h1 { font-size: clamp(41px, 5.2vw, 74px); font-weight: 800; line-height: 1.02; letter-spacing: -.077em; }
h1 b { font-weight: inherit; }
h1 span { color: #649276; }
.intro p { margin-top: 14px; color: var(--soft); font-size: clamp(14px, 1.5vw, 16px); line-height: 1.65; }
.pair {
  display: flex; align-items: center; justify-content: center; gap: 20px; flex: 0 0 auto;
  padding: 10px 19px 9px; border: 1px solid #dfe5d8; border-radius: 17px; background: #edf1e6;
}
.pair div { display: grid; min-width: 56px; place-items: center; }
.language-name { font-size: 20px; line-height: 1.4; font-weight: 800; letter-spacing: -.032em; }
.persian, [lang="fa"] { font-family: Vazirmatn, Tahoma, sans-serif; letter-spacing: normal; }
[dir="rtl"] :is(.brand, h1, .state-title, .history-head h2) { letter-spacing: normal; }
.signal, input[type="range"] { direction: ltr; }
.language-caption { color: #536458; font-size: 10px; font-weight: 750; }
.pair-arrow { color: #53755f; font-size: 22px; line-height: 1; padding-bottom: 8px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; }
.studio, .history { min-height: 460px; height: 460px; border-radius: 24px; overflow: hidden; }
.studio {
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  padding: 23px 26px 27px; color: #f2f5e9;
  background: radial-gradient(ellipse at 49% 40%, #284c38 0%, #1a382c 57%, #173328 100%);
}
.studio-head { z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.studio-head h2 { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 750; }
.studio-dot { background: #a9d88f; box-shadow: 0 0 0 4px #cfedb01b; }
.studio[data-state="speech"] .studio-dot { background: #dcffa9; box-shadow: 0 0 0 4px #cfedb044; }
.studio-mode {
  padding: 5px 9px; border: 1px solid #c7e5ce34; border-radius: 7px;
  color: #d5e8d6; background: #dbf0d510; font-size: 11px; font-weight: 750; white-space: nowrap;
}
.signal { flex: 1; position: relative; display: grid; place-items: center; min-height: 175px; }
.orbit { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); aspect-ratio: 1; border-radius: 50%; pointer-events: none; }
.orbit.outer { width: min(350px, 92%); border: 1px solid #d8f5cd10; }
.orbit.middle { width: min(273px, 72%); border: 1px solid #d8f5cd17; }
.orbit.inner { width: min(195px, 51%); border: 1px solid #d8f5cd21; background: #c4ffb205; }
.waveform { position: relative; display: flex; align-items: center; gap: clamp(3px, .45vw, 6px); padding: 8px 0; max-width: 95%; }
.waveform i { width: clamp(3px, .48vw, 6px); height: var(--height); background: var(--color); border-radius: 10px; box-shadow: 0 0 14px #a4e68c22; transform: scaleY(.84); }
.studio[data-state="listening"] .waveform i { animation: wave 1.45s var(--delay) ease-in-out infinite alternate; }
.studio[data-state="speech"] .waveform i, .studio[data-state="speaking"] .waveform i,
.studio[data-state="sample"] .waveform i { animation: wave .5s var(--delay) ease-in-out infinite alternate; }
.studio[data-state="ending"] .waveform i, .studio[data-state="working"] .waveform i { animation: wave .9s var(--delay) ease-in-out infinite alternate; }
@keyframes wave { from { transform: scaleY(.36); opacity: .66; } to { transform: scaleY(1.12); opacity: 1; } }
.studio-content { z-index: 1; text-align: center; padding: 12px 0 0; }
.state-title { font-weight: 800; font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -.053em; }
.state-description { color: #c4d5c7; font-size: 13px; margin-top: 9px; line-height: 1.5; min-height: 2.25em; }
.listen-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 183px; min-height: 52px; padding: 0 20px; margin-top: 14px;
  border: 0; border-radius: 13px; background: var(--mint); color: #1c3427; font-size: 14px; font-weight: 800;
}
.listen-button:hover:not(:disabled) { background: #e5f7c5; }
.listen-button:focus-visible { outline-color: #f4ffdf; }

.history { background: #fcfcf7; border: 1px solid var(--line); display: flex; flex-direction: column; }
.history-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 25px 19px; gap: 8px; border-bottom: 1px solid #e9eae2; }
.history-head h2 { font-size: 23px; font-weight: 800; letter-spacing: -.045em; }
.history-head p { font-size: 12px; color: var(--soft); margin-top: 5px; }
.quiet-button, .sample-button, .replay { color: #365f47; font-weight: 800; border: 0; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 12px; }
.quiet-button:hover, .sample-button:hover:not(:disabled), .replay:hover { background: #e7efe3; }
.empty { flex: 1; display: grid; place-content: center; justify-items: center; padding: 0 15px 19px; gap: 11px; text-align: center; }
.empty p { font-size: 14px; font-weight: 750; }
.sample-button span { font-size: 15px; margin-right: 3px; }
.bubbles { position: relative; display: block; width: 66px; height: 59px; margin-bottom: 7px; }
.bubbles i { position: absolute; width: 39px; height: 30px; border: 1.5px solid #8ba997; border-radius: 10px; background: #eef3e9; }
.bubbles i:first-child { top: 3px; left: 4px; transform: rotate(-10deg); }
.bubbles i:last-child { top: 21px; left: 23px; transform: rotate(9deg); display: flex; align-items: center; justify-content: center; gap: 4px; background: #dbeada; }
.bubbles i::after { content: ""; position: absolute; width: 7px; height: 7px; bottom: -4px; left: 9px; transform: skewY(-40deg) rotate(-5deg); border-left: 1.5px solid #8ba997; border-bottom: 1.5px solid #8ba997; background: inherit; }
.bubbles i:last-child::after { left: 23px; }
.bubbles b { width: 3px; height: 3px; border-radius: 50%; background: #61806b; }
.turns { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 16px 20px 20px; }
.turns li { padding: 13px 15px 9px; background: #eef3e9; border: 1px solid #e1eade; border-radius: 13px; margin-bottom: 11px; overflow-wrap: anywhere; }
.turn-direction { font-size: 11px; font-weight: 800; color: #40634d; padding-bottom: 7px; }
.original { color: #4b6053; font-size: 13px; margin-bottom: 5px; line-height: 1.6; }
.translated { color: #1e392b; font-size: 17px; line-height: 1.55; font-weight: 750; }
.replay:disabled { cursor: default; }
.replay { display: block; margin-top: 3px; margin-inline-start: -8px; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fcfcf7; }
.control { min-width: 0; padding: 15px 20px; display: flex; align-items: center; gap: 11px; min-height: 77px; }
.control + .control { border-inline-start: 1px solid var(--line); }
.control-icon {
  width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border-radius: 10px; background: #eaf0e5; color: #486d55;
}
.control-label { display: grid; gap: 2px; flex: 1 0 auto; }
.control-label label { font-size: 13px; font-weight: 800; }
.control-label span { font-size: 11px; color: var(--soft); }
select { min-height: 35px; border: 1px solid #dce5d9; border-radius: 8px; color: #2f523e; background: #f1f5ec; padding: 0 7px; font-size: 13px; }
input[type="range"] {
  --volume: 100%; appearance: none; min-width: 35px; width: clamp(48px, 13vw, 132px);
  height: 5px; margin: 0; border-radius: 10px; background: linear-gradient(90deg, #5a8469 var(--volume), #e1e9de var(--volume)); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #f7faf2; background: #477b5b; box-shadow: 0 0 0 1px #477b5b; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #f7faf2; background: #477b5b; box-shadow: 0 0 0 1px #477b5b; }
output { min-width: 38px; font-size: 12px; color: #405746; text-align: right; font-variant-numeric: tabular-nums; }

.icon { position: relative; display: block; width: 17px; height: 17px; flex: 0 0 17px; }
.icon::before, .icon::after, .privacy-icon::before, .privacy-icon::after { content: ""; position: absolute; }
.mic::before { border-radius: 6px; border: 1.6px solid currentColor; width: 6px; height: 10px; top: 0; left: 5px; }
.mic::after { left: 2px; top: 5px; width: 12px; height: 9px; border: 1.6px solid currentColor; border-top: 0; border-radius: 0 0 8px 8px; }
.mic { background: linear-gradient(currentColor, currentColor) 7px 13px / 2px 4px no-repeat; }
.stop::before { inset: 3px; border-radius: 2px; background: currentColor; }
.timer::before { border: 1.5px solid currentColor; bottom: 0; left: 2px; width: 13px; height: 13px; border-radius: 50%; }
.timer::after { top: 6px; left: 8px; width: 3px; height: 5px; border: 1.4px solid currentColor; border-right: 0; border-top: 0; }
.timer { background: linear-gradient(currentColor, currentColor) 6px 1px / 5px 1.5px no-repeat; }
.speaker::before { width: 11px; height: 13px; top: 2px; left: 0; background: currentColor; clip-path: polygon(0 29%,32% 29%,81% 0,81% 100%,32% 71%,0 71%); }
.speaker::after { width: 6px; height: 12px; left: 10px; top: 3px; border-right: 1.7px solid currentColor; border-radius: 50%; }
footer { color: var(--soft); font-size: 11px; display: flex; align-items: center; gap: 7px; justify-content: center; min-height: 61px; }
.privacy-icon { width: 13px; height: 13px; position: relative; }
.privacy-icon::before { top: 0; left: 3px; width: 7px; height: 8px; border: 1px solid #5b7965; border-radius: 8px; }
.privacy-icon::after { top: 5px; left: 1px; width: 11px; height: 8px; border: 1px solid #5b7965; border-radius: 2px; background: #f5f5ed; }

@media (max-width: 820px) {
  .wrap { width: calc(100% - 44px); }
  .intro { padding-top: 42px; }
  .studio, .history { height: 420px; min-height: 420px; }
  .control { padding-inline: 13px; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 28px); }
  .topbar { min-height: 61px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 16px; padding: 29px 0 20px; }
  .intro p { margin-top: 9px; }
  .pair { gap: 12px; padding: 4px 10px; border-radius: 11px; }
  .pair div { min-width: 48px; }
  .language-name { font-size: 17px; }
  .workspace, .controls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .studio { min-height: 385px; height: 385px; padding: 18px 17px 22px; }
  .history { min-height: 287px; height: 287px; }
  .history-head { padding: 15px 17px 12px; }
  .history-head h2 { font-size: 20px; }
  .controls { margin-top: 12px; gap: 0; }
  .control { min-height: 65px; }
  .control + .control { border-inline-start: 0; border-top: 1px solid var(--line); }
  input[type="range"] { width: clamp(60px, 21vw, 132px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
fieldset.pair { margin: 0; gap: 13px; align-items: end; }
.pair label { display: grid; gap: 5px; color: #4c6254; font-size: 11px; font-weight: 800; min-width: 120px; }
.pair select { width: 100%; min-height: 39px; background: #fcfcf7; padding-inline: 9px; }
.pair select:disabled { opacity: .8; }
.pair-arrow { padding-bottom: 9px; }
.settings summary { width: fit-content; margin: 18px auto 0; color: #496451; font-size: 12px; cursor: pointer; }
.settings .controls { margin-top: 10px; }
@media (max-width: 400px) {
  fieldset.pair { width: 100%; gap: 7px; }
  .pair label { min-width: 0; flex: 1; }
  .pair select { font-size: 12px; }
}
