/* ==========================================================================
   BlueTTS — site stylesheet
   One system: tokens → base → components → sections → responsive.
   Every selector the HTML or script.js touches is kept.
   ========================================================================== */

@font-face {
    font-family: 'Euclid Circular B';
    src: url('fonts/EuclidCircularB.woff2') format('woff2');
    font-style: normal;
    font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --font-display: 'Euclid Circular B', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Brand */
    --blue-50:  #EEF4FF;
    --blue-100: #DBE7FF;
    --blue-200: #B9D0FF;
    --blue-400: #4F8BFF;
    --blue-500: #2F6FEB;
    --blue-600: #1F5AD1;
    --blue-700: #1A46A8;
    --navy:     #0B1A3A;
    --navy-2:   #12275A;

    --accent: var(--blue-500);
    --accent-strong: var(--blue-600);
    --primary-blue: var(--blue-500);
    --deep-blue: var(--blue-600);

    /* Surfaces */
    --bg: #FFFFFF;
    --bg-soft: #F6F8FC;
    --bg-tint: var(--blue-50);
    --surface: #FFFFFF;
    --bg-light: var(--bg-soft);
    --bg-lighter: #FFFFFF;

    /* Ink */
    --ink: #0E1628;
    --ink-2: #4A5570;
    --ink-3: #8A94AB;
    --text: var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted: var(--ink-3);

    /* Lines */
    --line: #E6EAF2;
    --line-strong: #D5DCEA;
    --border: var(--line);
    --border-color: var(--line);

    /* Semantic */
    --success: #16A34A;
    --warning: #D97706;
    --error: #DC2626;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(14, 22, 40, 0.05);
    --shadow-sm: 0 1px 2px rgba(14, 22, 40, 0.05), 0 2px 8px rgba(14, 22, 40, 0.05);
    --shadow-md: 0 2px 4px rgba(14, 22, 40, 0.04), 0 12px 32px -8px rgba(14, 22, 40, 0.12);
    --shadow-lg: 0 4px 8px rgba(14, 22, 40, 0.04), 0 28px 64px -16px rgba(14, 22, 40, 0.18);
    --shadow-blue: 0 8px 24px -8px rgba(47, 111, 235, 0.55);

    /* Shape & motion */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 999px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --transition: all 0.2s var(--ease);

    /* Layout */
    --container: 1120px;
    --gutter: clamp(1.25rem, 4vw, 2rem);
    --section-y: clamp(4.5rem, 9vw, 7rem);
    --section-y-sm: clamp(3rem, 6vw, 4.5rem);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv11', 'ss01';
    overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
select, input, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-sm);
}

::selection { background: var(--blue-200); color: var(--navy); }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

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

/* Language-scoped spans (JS-generated) */
[data-lang="en"] .lang-he,
[data-lang="he"] .lang-en,
[data-lang="ru"] .lang-en, [data-lang="ru"] .lang-he,
[data-lang="es"] .lang-en, [data-lang="es"] .lang-he,
[data-lang="it"] .lang-en, [data-lang="it"] .lang-he,
[data-lang="de"] .lang-en, [data-lang="de"] .lang-he { display: none; }
[data-lang="ru"] .lang-en, [data-lang="es"] .lang-en,
[data-lang="it"] .lang-en, [data-lang="de"] .lang-en { display: inline; }

/* Section rhythm */
section { position: relative; padding: var(--section-y) 0; }

.section-title {
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
    text-align: center;
    margin-bottom: 0.75rem;
}
.section-subtitle {
    text-align: center;
    color: var(--ink-2);
    font-size: 1.0625rem;
    max-width: 38rem;
    margin: 0 auto 2.75rem;
    text-wrap: balance;
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 10px 28px -8px rgba(47, 111, 235, 0.7); transform: translateY(-1px); }

.btn-outline {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: var(--ink-3); background: var(--bg-soft); transform: translateY(-1px); }

.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.875rem; }
.btn-hero, .btn-hero-secondary { padding: 0.9rem 1.5rem; font-size: 1rem; }
.btn-large { padding: 0.95rem 1.6rem; font-size: 1rem; }
.btn-icon { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo-section { display: flex; align-items: center; gap: 0.6rem; }
.logo { width: 32px; height: 32px; border-radius: 8px; }
.brand-name { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

.header-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--r-pill);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-2);
    transition: var(--transition);
}
.nav-link:hover { color: var(--ink); background: var(--bg-soft); }
.nav-icon { font-size: 1rem; line-height: 1; }
.header-nav .btn { margin-left: 0.5rem; }

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
    padding: clamp(4.5rem, 10vw, 7.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
    overflow: hidden;
    background:
        radial-gradient(60% 55% at 50% 0%, rgba(47, 111, 235, 0.14), transparent 70%),
        linear-gradient(180deg, #FFFFFF 0%, var(--bg-soft) 100%);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(14, 22, 40, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 22, 40, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 100%);
    mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 100%);
    pointer-events: none;
}
.hero-orb-center { display: none; }

.hero-content {
    position: relative;
    max-width: 52rem;
    margin: 0 auto;
    text-align: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    border-radius: var(--r-pill);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 1.75rem;
}
.hero-eyebrow-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.hero-eyebrow-sep { color: var(--ink-3); }

.hero-title {
    font-size: clamp(2.75rem, 7vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 1.5rem;
}
.hero-title .accent {
    color: var(--accent);
}

.hero-subtitle {
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    color: var(--ink-2);
    max-width: 36rem;
    margin: 0 auto 2.25rem;
    text-wrap: balance;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.hero-stats {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 0.25rem;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.9rem 1.75rem;
    min-width: 11rem;
}
.hero-stat-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1;
}
.hero-stat-label {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--ink-3);
    white-space: nowrap;
}
.hero-stat-divider { width: 1px; background: var(--line); margin: 0.75rem 0; }

/* --------------------------------------------------------------------------
   6. Bots
   -------------------------------------------------------------------------- */
.bots-section { background: var(--bg); border-top: 1px solid var(--line); }

.bot-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin: 0 auto 2rem;
    max-width: 44rem;
}
.bot-stat {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.4rem 1.25rem;
    position: relative;
}
.bot-stat + .bot-stat::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    height: 1.1rem; width: 1px;
    background: var(--line-strong);
    transform: translateY(-50%);
}
.bot-stat-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.bot-stat-label { font-size: 0.85rem; color: var(--ink-3); }
.bot-stats[data-state="loading"] .bot-stat-value { color: var(--ink-3); }
.bot-stats[data-state="error"] { display: none; }

.bot-stats-note {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.bot-stats-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
    70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 46rem;
    margin: 0 auto;
}
.bot-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.bot-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.bot-icon {
    flex: none;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border-radius: 14px;
    color: #fff;
}
.bot-card-wa .bot-icon { background: #25D366; }
.bot-card-tg .bot-icon { background: #2AABEE; }
.bot-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bot-name { font-weight: 600; font-size: 1rem; }
.bot-handle { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); margin-top: 0.15rem; white-space: nowrap; }
.bot-count { font-size: 0.78rem; color: var(--ink-3); margin-top: 0.3rem; }
.bot-count strong { color: var(--ink); font-weight: 600; }
.bot-cta {
    flex: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    padding: 0.45rem 0.8rem;
    border-radius: var(--r-pill);
    background: var(--blue-50);
    transition: var(--transition);
}
.bot-card:hover .bot-cta { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------------------
   7. Demo — studio
   -------------------------------------------------------------------------- */
.demo {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.demo-container {
    max-width: 44rem;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.studio-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.studio-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--bg-soft);
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}
.studio-pill:hover, .studio-pill:focus-within { border-color: var(--line-strong); background: #fff; }
.studio-pill-icon { color: var(--ink-3); flex: none; }
.studio-pill-chevron { color: var(--ink-3); flex: none; pointer-events: none; }
.studio-select {
    -webkit-appearance: none; appearance: none;
    background: transparent; border: 0;
    padding: 0; padding-right: 0.15rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}
.studio-icon-btn {
    margin-left: auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--bg-soft);
    color: var(--ink-2);
    transition: var(--transition);
}
.studio-icon-btn:hover { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.studio-icon-btn[aria-expanded="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.demo-input-wrapper { padding: 0.25rem 0.5rem 0; }
.demo-input {
    display: block;
    width: 100%;
    min-height: 132px;
    padding: 1rem 0.85rem 0.75rem;
    border: 0;
    outline: none;
    resize: vertical;
    background: transparent;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--ink);
}
.demo-input::placeholder { color: var(--ink-3); }
.demo-input[dir="rtl"] { text-align: right; }

.preset-controls-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem 0.9rem;
    flex-wrap: wrap;
}
.preset-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.preset-items { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.preset-item {
    padding: 0.3rem 0.7rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--transition);
}
.preset-item:hover { border-color: var(--line-strong); color: var(--ink); }
.preset-item.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* advanced panel */
.studio-advanced {
    padding: 1rem 1.25rem 0.25rem;
    border-top: 1px dashed var(--line-strong);
    background: var(--bg-soft);
    display: grid;
    gap: 1rem;
}
.studio-advanced[hidden] { display: none; }

.demo-setting { display: grid; gap: 0.45rem; }
.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
}
.quality-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.1rem 0.45rem;
}
.slider-wrapper { display: flex; align-items: center; gap: 0.75rem; }
.slider-tick { font-size: 0.7rem; color: var(--ink-3); width: 2.2rem; }
.slider-tick:last-child { text-align: right; }
.setting-slider {
    -webkit-appearance: none; appearance: none;
    flex: 1; height: 4px;
    border-radius: 999px;
    background: var(--line-strong);
    outline: none;
}
.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform 0.15s var(--ease);
}
.setting-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.setting-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid var(--accent);
    box-shadow: var(--shadow-sm); cursor: grab;
}

/* browser engine + download */
.studio-engine {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.85rem 1rem;
}
.studio-engine-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    cursor: pointer;
}
.studio-engine-head input {
    margin-top: 0.2rem;
    width: 16px; height: 16px;
    accent-color: var(--accent);
    flex: none;
}
.studio-engine-text { display: flex; flex-direction: column; font-size: 0.9rem; font-weight: 600; }
.studio-engine-text small { font-weight: 400; font-size: 0.78rem; color: var(--ink-3); margin-top: 0.1rem; }

.studio-download { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.studio-download[hidden] { display: none; }
.studio-download-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.studio-download-state { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-2); }
.studio-download-btn {
    padding: 0.4rem 0.85rem;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transition);
}
.studio-download-btn:hover { background: var(--accent-strong); }
.studio-download-btn:disabled { opacity: 0.55; cursor: default; }
.studio-download-bar {
    height: 6px; margin-top: 0.7rem;
    background: var(--line);
    border-radius: 999px; overflow: hidden;
}
.studio-download-bar[hidden] { display: none; }
.studio-download-bar span {
    display: block; height: 100%; width: 0;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.2s linear;
}
.studio-download-note { margin-top: 0.6rem; font-size: 0.75rem; color: var(--ink-3); }

/* footer row: counter + speak */
.studio-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--line);
    background: #fff;
}
.demo-char-counter { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); }
.demo-char-counter.warning { color: var(--warning); }

.demo-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 1.25rem 0 1.4rem;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}
.demo-btn:hover { background: var(--accent); box-shadow: var(--shadow-blue); transform: translateY(-1px); }
.demo-btn:disabled { cursor: default; opacity: 0.85; transform: none; }
.demo-btn .speak-icon { transition: transform 0.2s var(--ease); }
.demo-btn:hover .speak-icon { transform: translateX(2px); }
.demo-btn.loading { background: var(--accent); }
.demo-btn.loading .speak-icon { display: none; }
.demo-btn.loading::after {
    content: '';
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* status */
.status-message {
    display: none;
    margin: 0 1.25rem 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    line-height: 1.45;
}
.status-message.visible { display: block; }
.status-message.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.status-message.warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.status-message.info { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-200); }
.progress-container { display: none !important; }

/* generated audio history */
.audio-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem 0.5rem;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}
.audio-history-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}
.clear-audio-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-2);
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
    transition: var(--transition);
}
.clear-audio-btn:hover { background: #fff; color: var(--error); }

#audioHistoryContainer {
    display: grid;
    gap: 0.6rem;
    padding: 0 1.25rem 1.25rem;
    background: var(--bg-soft);
}
.generated-audio-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.85rem 1rem;
    animation: rise 0.3s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.audio-item-header { display: flex; justify-content: space-between; margin-bottom: 0.6rem; }
.audio-item-label { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.audio-item-stats { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.7rem; }
.stat-item { display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink); }
.stat-label { font-size: 0.7rem; color: var(--ink-3); }
.stat-divider { width: 1px; height: 1.6rem; background: var(--line); }
.audio-item-player audio { width: 100%; height: 40px; }

.demo-note {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   8. V2 announcement
   -------------------------------------------------------------------------- */
.v2-announce { padding-bottom: var(--section-y-sm); }
.v2-card {
    position: relative;
    overflow: hidden;
    max-width: 62rem;
    margin: 0 auto;
    padding: clamp(2.25rem, 5vw, 3.5rem);
    border-radius: var(--r-xl);
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow-lg);
}
.v2-card::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(45% 60% at 100% 0%, rgba(79, 139, 255, 0.35), transparent 70%),
        radial-gradient(35% 50% at 0% 100%, rgba(79, 139, 255, 0.18), transparent 70%);
    pointer-events: none;
}
.v2-card > * { position: relative; }
.v2-title { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.5rem); text-align: center; }
.v2-mark { color: var(--blue-400); }
.v2-subtitle { text-align: center; color: rgba(255,255,255,0.7); margin: 0.6rem 0 2rem; }

.v2-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.v2-features li {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}
.v2-dot {
    flex: none;
    width: 8px; height: 8px;
    margin-top: 0.55rem;
    border-radius: 50%;
    background: var(--blue-400);
    box-shadow: 0 0 0 4px rgba(79, 139, 255, 0.2);
    font-size: 0;
    color: transparent;
}
.v2-features strong { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.15rem; }
.v2-features span:not(.v2-dot) { font-size: 0.875rem; color: rgba(255,255,255,0.65); line-height: 1.5; }

.v2-links { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.v2-links .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); box-shadow: none; }
.v2-links .btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* --------------------------------------------------------------------------
   9. Languages
   -------------------------------------------------------------------------- */
.languages-section { background: var(--bg); }

.lang-audio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.lang-audio-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.lang-audio-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lang-card-body { padding: 1.25rem 1.25rem 1rem; display: flex; flex-direction: column; height: 100%; }
.lang-audio-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.lang-flag-wrap {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    font-size: 1.25rem;
}
.lang-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.lang-name { font-weight: 600; }
.lang-code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.06em; }
.lang-sentence {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-2);
    margin-bottom: 1rem;
    flex: 1;
}
.lang-sentence[dir="rtl"] { text-align: right; }
.lang-audio-wrap audio { width: 100%; height: 40px; }

/* --------------------------------------------------------------------------
   10. Video
   -------------------------------------------------------------------------- */
.video-demo { background: var(--bg-soft); border-top: 1px solid var(--line); }
.video-container {
    position: relative;
    max-width: 58rem;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--shadow-lg);
}
.video-container video { width: 100%; height: 100%; object-fit: cover; }
.video-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.35rem;
    background:
        radial-gradient(50% 60% at 50% 40%, rgba(79, 139, 255, 0.35), transparent 70%),
        var(--navy);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.3s var(--ease);
}
.video-overlay.hidden { opacity: 0; pointer-events: none; }
.video-overlay-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 0.5rem; }
.video-overlay-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.video-overlay-hint { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 1.25rem; }
.video-play-btn {
    width: 68px; height: 68px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 10px rgba(79, 139, 255, 0.2), var(--shadow-blue);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.video-play-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(79, 139, 255, 0.25), var(--shadow-blue); }
.video-play-btn svg { margin-left: 3px; }

/* --------------------------------------------------------------------------
   11. Desktop app
   -------------------------------------------------------------------------- */
.app-section { background: var(--bg); }
.app-card {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.app-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
    margin-bottom: 1rem;
}
.app-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.9rem; }
.app-description { color: var(--ink-2); margin-bottom: 1.5rem; max-width: 34rem; }
.app-features { display: grid; gap: 0.6rem; margin-bottom: 1.75rem; }
.app-features li { display: flex; gap: 0.7rem; font-size: 0.95rem; color: var(--ink-2); line-height: 1.5; }
.app-features li span:last-child { flex: 1; }
.app-features code {
    font-family: var(--font-mono);
    font-size: 0.8em;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 0.05rem 0.35rem;
    border-radius: 5px;
}
.app-check {
    flex: none;
    width: 20px; height: 20px;
    margin-top: 0.15rem;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--blue-50);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
}
.app-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.app-note { font-size: 0.8125rem; color: var(--ink-3); }

.app-visual { position: relative; }
.app-visual::before {
    content: '';
    position: absolute;
    inset: 10% -6% -6% 10%;
    background: radial-gradient(closest-side, rgba(47, 111, 235, 0.18), transparent);
    filter: blur(24px);
    z-index: 0;
}
.app-shot {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    background: #fff;
    z-index: 1;
}
.app-shot img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   12. CTA + footer
   -------------------------------------------------------------------------- */
.cta-section {
    background: var(--navy);
    color: #fff;
    text-align: center;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(50% 80% at 50% 100%, rgba(79, 139, 255, 0.3), transparent 70%);
    pointer-events: none;
}
.cta-section .container { position: relative; }
.cta-title { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 0.75rem; }
.cta-description { color: rgba(255,255,255,0.7); max-width: 32rem; margin: 0 auto 2rem; }
.cta-buttons { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.cta-buttons .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); box-shadow: none; }
.cta-buttons .btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

footer { background: var(--navy); color: rgba(255,255,255,0.7); padding: 2.5rem 0; border-top: 1px solid rgba(255,255,255,0.08); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.footer-logo { display: flex; align-items: center; gap: 0.5rem; }
.footer-logo-img { width: 28px; height: 28px; border-radius: 7px; }
.footer-brand { color: #fff; font-family: var(--font-display); font-weight: 600; }
.footer-text { font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.6rem; font-size: 0.875rem; }
.footer-links a { color: rgba(255,255,255,0.75); transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.link-separator { color: rgba(255,255,255,0.25); }
.footer-copyright { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   13. Legal page
   -------------------------------------------------------------------------- */
.legal-page { background: var(--bg-soft); padding: 3.5rem 0 4.5rem; min-height: 60vh; }
.legal-container { max-width: 46rem; }
.legal-header { margin-bottom: 2rem; }
.legal-back { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); margin-bottom: 1.25rem; }
.legal-back:hover { color: var(--accent); }
.legal-title { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 0.75rem; }
.legal-lede { color: var(--ink-2); font-size: 1.0625rem; }
.legal-updated { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); margin-top: 0.75rem; }
.legal-body { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: var(--shadow-sm); }
.legal-section + .legal-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.legal-section h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.legal-sub { font-weight: 600; margin: 1rem 0 0.4rem; }
.legal-section p { color: var(--ink-2); }
.legal-section p + p { margin-top: 0.75rem; }
.legal-section strong { color: var(--ink); }
.legal-list { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.legal-list li { position: relative; padding-left: 1.25rem; color: var(--ink-2); }
.legal-list li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.legal-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 0.75rem; }
.legal-table th, .legal-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { font-weight: 600; color: var(--ink); }

/* --------------------------------------------------------------------------
   14. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .lang-audio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-card { grid-template-columns: 1fr; }
    .app-visual { order: -1; max-width: 34rem; }
}

@media (max-width: 720px) {
    .nav-label { display: none; }
    .nav-link { padding: 0.5rem; }
    .header-content { height: 58px; }

    .hero-stats { flex-direction: column; width: 100%; max-width: 22rem; }
    .hero-stat { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 0.75rem 1rem; min-width: 0; }
    .hero-stat-label { margin: 0; }
    .hero-stat-divider { width: auto; height: 1px; margin: 0 0.75rem; }
    .hero-buttons .btn { width: 100%; }
    .hero-buttons { margin-bottom: 2.5rem; }

    .bot-grid { grid-template-columns: 1fr; }
    .bot-stat + .bot-stat::before { display: none; }
    .bot-stats { gap: 0.25rem 0; }
    .bot-stat { padding: 0.25rem 0.75rem; }

    .studio-bar { flex-wrap: wrap; }
    .studio-pill { flex: 1 1 auto; }
    .studio-foot { flex-wrap: wrap; }
    .demo-btn { width: 100%; justify-content: center; }
    .audio-item-stats { gap: 0.75rem; }

    .v2-features { grid-template-columns: 1fr; }
    .v2-links .btn, .cta-buttons .btn, .app-buttons .btn { width: 100%; }

    .lang-audio-grid { grid-template-columns: 1fr; }
    .video-container { border-radius: var(--r-lg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

@media (max-width: 520px) {
    .hero-title br { display: none; }
    .hero-title .accent { display: block; }
}
