/* Terminalia — subset WOFF2 (кириллица + латиница), TTF как запасной */
@font-face {
    font-family: 'Terminalia';
    src: url('../fonts/Terminalia-Light.woff2') format('woff2'),
         url('../fonts/Terminalia-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0020-007F, U+00A0-00FF, U+0400-04FF, U+2000-206F, U+20BD;
}

@font-face {
    font-family: 'Terminalia';
    src: url('../fonts/Terminalia-Regular.woff2') format('woff2'),
         url('../fonts/Terminalia-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0020-007F, U+00A0-00FF, U+0400-04FF, U+2000-206F, U+20BD;
}

@font-face {
    font-family: 'Terminalia';
    src: url('../fonts/Terminalia-Bold.woff2') format('woff2'),
         url('../fonts/Terminalia-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0020-007F, U+00A0-00FF, U+0400-04FF, U+2000-206F, U+20BD;
}

/* CSS Variables for design tokens */
:root {
    /* Colors */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-primary: #00F5C8;
    --color-primary-hover: #00E0B5;
    --color-gray-light: #D4DBD9;
    --color-gray-medium: #7F8784;
    --color-gray-dark: #6B5E5E;
    --color-text-dark: #2D3331;
    --color-text-muted: #585C5A;
    --color-bg-overlay: rgba(212, 219, 217, 0.3);
    --color-chat-bg: rgba(0, 254, 201, 0.15);

    /* Shadows */
    --shadow-light: 1px 1px 2px 0px rgba(0, 0, 0, 0.25);
    --shadow-medium: 1px 2px 3px 0px rgba(212, 219, 217, 1);
    --shadow-robot: 16px 3px 15px 0px rgba(22, 114, 95, 0.2);

    /* Typography */
    --font-family: 'Terminalia', sans-serif;
    --font-ui: 'Terminalia', sans-serif;
    --font-weight: 400;

    /* Colors aligned with mp_status */
    --text-primary: #4A4A4A; /* Темно-серый вместо #2D3331 */
    --text-secondary: #7f8784;
    --accent-green: #00fec9;

    /* Font sizes */
    --font-size-logo: 40px;
    --font-size-tagline: 20px;
    --font-size-section-title: 40px;
    --font-size-section-title-mobile: 35px;
    --font-size-subsection-title: 30px;
    --font-size-body: 20px;
    --font-size-small: 13px;
    --font-size-xs: 10px;

    /* Letter spacing */
    --letter-spacing-tight: 10%;
    --letter-spacing-normal: 13%;
    --letter-spacing-wide: 23%;
    --letter-spacing-extra-wide: 30%;

    /* Line heights */
    --line-height-tight: 1em;
    --line-height-normal: 1.3em;
    --line-height-body: 1.5em;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-xxl: 64px;

/* Layout - exact from Figma Frame 1 */
    --content-margin-x: 200px;   /* отступ контента от краёв 1920px */
    --header-height: 173px; /* From logo position */
    --logo-line-origin-x: 966px; /* центр лого 880+86, точка схода пунктиров */
    --logo-line-origin-y: 329px; /* низ лого 173+25+131 */
    --footer-height: 120px;
    --mobile-header-height: 120px;
    --mobile-footer-height: 80px;

    /* Breakpoints */
    --breakpoint-mobile: 768px;

    /* Border radius — золотой стандарт (8px grid) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.35s ease-out;
    --transition-normal: 0.4s ease-out;
    --transition-slow: 0.5s ease-in-out;

    /* Online Services Tab */
    --tab-bg: rgba(0, 254, 201, 0.12);
    --tab-border: rgba(0, 254, 201, 0.4);

    /* Z-indexes */
    --z-popup: 1000;
    --z-chat: 900;
    --z-tooltip: 800;
    --z-overlay: 700;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Масштабирование: всё влезает в viewport, без скролла. Блоки меняются анимацией. */
html {
    font-size: 16px;
    line-height: 1.5;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-family);
    font-weight: 300;
    background-color: var(--color-white);
    color: var(--color-black);
    overflow: hidden;
    overscroll-behavior: none;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    min-height: 100%;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Figma frame: 1920x1080 — масштаб задаёт JS (и ранний inline-скрипт в index.html). Не использовать 100vw в scale: vw шире видимой области из‑за скроллбара → завышенный scale и вылезание за экран. */
.figma-frame {
    width: 1920px;
    height: 1080px;
    position: fixed;
    top: 0;
    left: 50%;
    background: #FFFFFF;
    transform-origin: center top;
    transform: translate(-50%, 0) scale(0.5); /* до первого скрипта; затем перезаписывается */
    transition: background 0.3s ease;
    overflow: visible;
}

/* Обёртка контента — позиционирование header, main, lines, footer */
.main-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    transition: transform 0.35s ease-out, filter 0.35s ease;
}

/* Анимация Frame 1→5, Frame 2→6, Главная→Раздел — 350ms ease-out (CLAUDE) */
.header, .header-brand, .logo, .logo-text, .tagline, .section-title-in-header,
.section, .section-details, .subsections, .subsection,
.connection-lines, .connection-lines .line,
.chat-in-frame, .robot-dock, .robot-label, .robot-tab, .footer {
    transition: left 0.35s ease-out, right 0.35s ease-out, top 0.35s ease-out, transform 0.35s ease-out,
                opacity 0.35s ease-out, width 0.35s ease-out, height 0.35s ease-out;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: var(--line-height-tight);
}

p {
    line-height: var(--line-height-body);
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-uppercase {
    text-transform: uppercase;
}

.letter-spacing-tight {
    letter-spacing: var(--letter-spacing-tight);
}

.letter-spacing-normal {
    letter-spacing: var(--letter-spacing-normal);
}

.letter-spacing-wide {
    letter-spacing: var(--letter-spacing-wide);
}

/* Layout components */
.container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header: Figma Frame 1 — лого 880,198 172×131; ai_status 1040,173; подпись 1047,233 */
.header {
    position: absolute;
    width: 1920px;
    height: 400px;
    z-index: 100;
}

/* Кнопка переключения темы — правый верхний угол */
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 32px;
    width: 40px;
    height: 40px;
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(0, 254, 201, 0.12);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    z-index: 101;
}

.theme-toggle:hover {
    background: rgba(0, 254, 201, 0.2);
    border-color: var(--accent-green);
}

/* Подложка: лёгкое размытие всего фрейма при открытой закладке (закладка — выше слоя) */
.online-services-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    background: rgba(255, 255, 255, 0.14);
}

.figma-frame:has(.online-services-tab:hover) .online-services-backdrop,
.figma-frame:has(.online-services-tab.active) .online-services-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Подложка: затемнение + клик для закрытия; размытие — на слоях контента (см. ниже) */
.blog-backdrop {
    position: absolute;
    top: 0;
    left: calc(-1 * var(--frame-letterbox-x, 0px));
    width: calc(1920px + 2 * var(--frame-letterbox-x, 0px));
    height: 1080px;
    z-index: 195;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    background: rgba(255, 255, 255, 0.32);
}

.state-blog .blog-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* В режиме блога размываем всё, кроме панели блога (backdrop-filter не трогает верхние z-index) */
.state-blog .main-content-wrapper,
.state-blog .chat-wrapper,
.state-blog .robot-dock,
.state-blog .online-services-tab {
    filter: blur(8px);
    pointer-events: none;
}

.state-blog .online-services-backdrop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Оболочка блога: сдвиг влево на letterbox, чтобы вкладка была у края экрана */
.blog-panel {
    position: absolute;
    left: calc(-1 * var(--frame-letterbox-x, 0px));
    top: 0;
    width: 920px;
    height: 1080px;
    z-index: 200;
    pointer-events: none;
    overflow: visible;
    background: transparent;
    box-sizing: border-box;
}

/* Вкладка — всегда на левом краю фрейма; при открытии — у правого края панели */
.blog-tab {
    position: absolute;
    top: 72px;
    left: 0;
    z-index: 3;
    box-sizing: border-box;
    background: var(--color-primary);
    border: 0.5px dashed var(--tab-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 10px 18px;
    box-shadow: var(--shadow-medium);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--color-black);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
    pointer-events: none;
    text-align: center;
    /* старт за верхним краем экрана; .is-settled опускает на место */
    transform: translateY(calc(-100% - 72px - 24px));
    transition:
        left 0.35s ease-out,
        color 0.2s,
        background 0.2s,
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-tab.is-settled {
    transform: translateY(0);
    pointer-events: auto;
}

.blog-tab:hover {
    background: var(--color-primary-hover);
}

.state-blog .blog-tab {
    left: 100%;
    background: var(--color-primary-hover);
}

/* Закладки статей — под «блог», только в своём разделе */
.blog-article-tab {
    position: absolute;
    top: calc(72px + 42px + 12px);
    left: 0;
    z-index: 3;
    box-sizing: border-box;
    background: var(--color-primary);
    border: 0.5px dashed var(--tab-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 8px 16px;
    box-shadow: var(--shadow-medium);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--color-black);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-12px);
    transition:
        left 0.35s ease-out,
        opacity 0.35s ease,
        visibility 0.35s ease,
        transform 0.35s ease,
        background 0.2s,
        color 0.2s;
}

.blog-article-tab:hover {
    background: var(--color-primary-hover);
}

.state-section-implement .blog-article-tab[data-section="implement"],
.state-section-train .blog-article-tab[data-section="train"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* В открытой панели блога прячем закладки статей */
.state-blog .blog-article-tab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-12px);
}

@media (prefers-reduced-motion: reduce) {
    .blog-tab {
        transform: none;
        pointer-events: auto;
        transition: left 0.35s ease-out, color 0.2s, background 0.2s;
    }

    .blog-article-tab {
        transform: none;
        transition: left 0.35s ease-out, opacity 0.2s, visibility 0.2s, background 0.2s;
    }
}

/* Лист с контентом — выезжает слева */
.blog-panel-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.35s ease-out;
    pointer-events: none;
    background: var(--color-white);
    border-right: 0.5px dashed rgba(0, 254, 201, 0.4);
    box-sizing: border-box;
    overflow: hidden;
}

.state-blog .blog-panel-sheet {
    transform: translateX(0);
    pointer-events: auto;
}

.theme-dark .blog-panel-sheet {
    background: rgba(0, 254, 201, 0.08);
    border-right-color: rgba(0, 254, 201, 0.4);
    box-shadow: 3px 3px 10px 0 rgba(0, 0, 0, 0.3);
}

.theme-dark .blog-panel-title,
.theme-dark .blog-tile-title {
    color: var(--text-primary);
}

.theme-dark .blog-panel-sub,
.theme-dark .blog-tile-dek,
.theme-dark .blog-panel-all,
.theme-dark .blog-tile-meta,
.theme-dark .blog-tile-eyebrow {
    color: var(--text-secondary);
}

.theme-dark .blog-tile {
    background: rgba(0, 254, 201, 0.1);
    border-color: rgba(0, 254, 201, 0.45);
}

.theme-dark a.blog-tile {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(0, 254, 201, 0.55);
}

.theme-dark .blog-tile:hover {
    background: rgba(0, 254, 201, 0.18);
}

.theme-dark a.blog-tile:hover {
    background: rgba(0, 0, 0, 0.5);
}

.theme-dark .blog-tile-soon:hover {
    background: rgba(0, 254, 201, 0.1);
}

.theme-dark .blog-panel-all {
    border-bottom-color: rgba(0, 254, 201, 0.5);
}

.theme-dark .blog-panel-all:hover {
    color: var(--accent-green);
}

.blog-panel-inner {
    height: 100%;
    padding: 72px 48px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.blog-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.blog-panel-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.blog-panel-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex: none;
}

.blog-panel-title {
    font-family: var(--font-family);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--text-primary, #2D3331);
    line-height: 1.2;
}

.blog-panel-sub {
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--text-secondary, #6B736F);
    margin-top: 4px;
}

.blog-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    align-content: start;
}

.blog-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    padding: 20px;
    background: rgba(0, 254, 201, 0.06);
    border: 0.5px dashed rgba(0, 254, 201, 0.35);
    border-radius: var(--radius-lg, 16px);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Активные статьи — чуть плотнее/темнее «скоро» */
a.blog-tile {
    background: rgba(0, 254, 201, 0.14);
    border-color: rgba(0, 254, 201, 0.5);
}

.blog-tile:hover {
    background: rgba(0, 254, 201, 0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium, 3px 3px 10px rgba(212, 219, 217, 0.8));
}

a.blog-tile:hover {
    background: rgba(0, 254, 201, 0.22);
}

.blog-tile:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.blog-tile-feature {
    grid-column: span 2;
    min-height: 180px;
}

.blog-tile-eyebrow {
    font-family: var(--font-family);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: lowercase;
    color: var(--color-gray-medium, #8A918D);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-tile-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    flex: none;
}

.blog-tile-title {
    font-family: var(--font-family);
    font-weight: 400;
    font-size: 18px;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    line-height: 1.25;
    margin: 0 0 auto;
    color: var(--text-primary, #2D3331);
}

.blog-tile-feature .blog-tile-title {
    font-size: 24px;
}

.blog-tile-dek {
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--text-secondary, #6B736F);
    margin: 10px 0 12px;
}

.blog-tile-meta {
    font-family: var(--font-family);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--text-muted, #9AA19D);
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: auto;
}

.blog-tile-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.blog-tile-soon {
    opacity: 0.55;
    cursor: default;
    border-style: dotted;
    pointer-events: none;
}

.blog-tile-soon:hover {
    background: rgba(0, 254, 201, 0.06);
    transform: none;
    box-shadow: none;
}

.blog-tile-soon .blog-tile-eyebrow::before {
    background: var(--color-gray-medium, #8A918D);
}

.blog-panel-all {
    margin-top: 24px;
    align-self: flex-start;
    font-family: var(--font-family);
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--text-secondary, #6B736F);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 254, 201, 0.5);
    padding-bottom: 2px;
}

.blog-panel-all:hover {
    color: var(--color-primary-hover, #00d4aa);
}

/* Online Services Tab — справа от вкладки блога */
.online-services-tab {
    position: absolute;
    top: 0;
    left: var(--content-margin-x);
    transform: translateY(-100%);
    background: var(--color-primary);
    border: 0.5px dashed var(--tab-border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 24px;
    z-index: 210;
    transition: transform var(--transition-normal), left 0.35s ease-out;
    width: 380px;
    box-shadow: var(--shadow-medium);
}

.online-services-tab:hover,
.online-services-tab.active {
    transform: translateY(0);
}

/* Режим чата: закладка едет правее середины (визуальный баланс с панелью справа) */
.state-chat .online-services-tab {
    left: calc(50% + 140px);
    transform: translate(-50%, -100%);
}

.state-chat .online-services-tab:hover,
.state-chat .online-services-tab.active {
    transform: translate(-50%, 0);
}

.tab-handle {
    display: none; /* Отключено по просьбе пользователя */
    position: absolute;
    bottom: -40px;
    left: 24px;
    background: var(--color-primary);
    color: var(--color-black);
    padding: 8px 24px;
    border-radius: 0 0 12px 12px;
    font-size: 18px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 254, 201, 0.2);
    transition: background 0.2s;
}

.online-services-tab:hover .tab-handle {
    background: var(--color-primary-hover);
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-button {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.2); /* Светлая подложка кнопки на зеленом фоне */
    border: 0.5px dashed rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-black);
    transition: all 0.2s;
}

.service-button:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.service-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.service-desc {
    font-size: 16px;
    opacity: 0.8;
    line-height: 1.3;
}

/* Анимация перелистывания при уходе на другой сайт */
body.slide-out-left {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.6s ease !important;
    pointer-events: none;
    background: var(--color-white) !important;
}

body.slide-out-right {
    transform: translateX(100%) !important;
    opacity: 0 !important;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.6s ease !important;
    pointer-events: none;
    background: var(--color-white) !important;
}

.theme-dark.slide-out-left,
.theme-dark.slide-out-right {
    background: #2D2E2B !important;
}

.theme-dark .online-services-tab,
.theme-dark .blog-tab,
.theme-dark .blog-article-tab,
.theme-dark .robot-tab {
    background: var(--color-primary); /* Оставляем зеленый и в темной теме для акцента */
    color: #2D2E2B;
}

.theme-dark .tab-handle {
    color: #2D2E2B;
}

.theme-dark .service-button {
    background: rgba(0, 0, 0, 0.15);
    color: #2D2E2B;
}

.theme-dark .service-desc {
    color: rgba(0, 0, 0, 0.6);
}

.theme-icon {
    position: absolute;
    transition: opacity 0.2s;
}

.theme-icon-moon {
    opacity: 0;
}

.theme-icon-sun {
    opacity: 1;
}

.theme-dark .theme-icon-moon {
    opacity: 1;
}

.theme-dark .theme-icon-sun {
    opacity: 0;
}

/* Frame 1: лого по центру, центр совпадает с точкой схода пунктиров */
.header-brand {
    cursor: pointer;
    position: absolute;
    left: calc(var(--logo-line-origin-x) - 86px);   /* 966-86: центр лого = origin */
    top: 173px;
}

.logo {
    position: absolute;
    left: 0;
    top: 25px;     /* 198-173: лого y=198 */
    display: flex;
    align-items: center;
}

/* Обёртка пирамиды — line-origin привязан к ней */
.logo-pyramid {
    position: relative;
    width: 172px;
    height: 131px;
    flex-shrink: 0;
}

/* Якорь для линий — 10px под пирамидой по центру */
.line-origin {
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translate(-50%, 0);
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.logo-image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ai_status и tagline — справа от лого, выровнены по левому краю */
.logo-text {
    position: absolute;
    left: 160px;
    top: -10px;    /* поднят на 10px */
    font-size: 40px;
    letter-spacing: 0.1em;
    color: #000000;
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1em;
}

.section-title-in-header {
    position: absolute;
    left: 160px;
    top: 55px;
    font-size: 40px;
    line-height: 1em;
    letter-spacing: 0.1em;
    color: var(--color-gray-medium);
    font-family: var(--font-family);
    font-weight: 400;
    opacity: 0;
    pointer-events: none;
}

/* Летящий заголовок при переходе главная → раздел — цвет как у section-title, без смены */
.section-title-fly {
    position: absolute;
    z-index: 200;
    pointer-events: none;
    font-size: 40px;
    line-height: 1em;
    letter-spacing: 0.1em;
    color: var(--color-text-dark);
    font-family: var(--font-family);
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: none;
}

.section-title-fly.active {
    opacity: 1;
    visibility: visible;
}

.tagline {
    position: absolute;
    left: 160px;   /* выровнено по левому краю с ai_status */
    top: 55px;     /* поднято на 5px (было 60) */
    font-size: 20px;
    letter-spacing: 0.1em;
    color: var(--color-gray-medium);
    opacity: 0.7;
    font-family: var(--font-family);
    font-weight: 400;
    text-align: left;
    line-height: 1em;
    white-space: nowrap;
}

/* Main content - Figma positions */
.main {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
}

/* Sections - Frame 1: выровнены по --content-margin-x 200px */
.sections {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
}

.section {
    position: absolute;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.section:nth-child(1) {
    left: var(--content-margin-x);
    top: 691px;
    width: 380px;
}

.section:nth-child(2) {
    left: 803px;   /* 200+380+223 gap */
    top: 691px;
    width: 345px;
}

.section:nth-child(3) {
    left: 1371px;   /* 803+345+223 */
    top: 691px;
    width: 349px;
}

.section-title {
    font-size: 40px;
    line-height: 1em;
    letter-spacing: 0.1em;
    color: var(--color-text-dark);
    font-family: var(--font-family);
    font-weight: 400;
    margin: 0 0 17px;
    white-space: nowrap;
}

.section-description {
    font-size: 20px;
    letter-spacing: 0.1em;
    line-height: 1.3em;
    color: var(--color-gray-medium);
    opacity: 0.7;
    font-family: var(--font-family);
    font-weight: 400;
}

/* Section details - shown when section opened, позиции как у разделов Frame 5 */
.section-details {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-out;
}

.subsections {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
}

.subsection {
    position: absolute;
    padding: 0 0 12px 0;   /* снизу — чтобы закругления price-info не обрезались */
    max-height: 390px;   /* 360 + 30 — тексты влезают */
    overflow-y: auto;
    transition: left 0.35s ease-out, top 0.35s ease-out, width 0.35s ease-out, opacity 0.35s ease-out;
}

/* Позиции подразделов — Frame 2, выровнены по --content-margin-x */
.section-details .subsection:nth-child(1) {
    left: var(--content-margin-x);
    top: 451px;
    width: 500px;
}

.section-details .subsection:nth-child(2) {
    left: 750px;   /* 200+500+50 gap */
    top: 451px;
    width: 500px;
}

.section-details .subsection:nth-child(3) {
    left: 1300px;  /* 750+500+50 */
    top: 451px;
    width: 500px;
}

.subsection-title {
    font-size: var(--font-size-subsection-title);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-black);
    font-weight: 400;
    margin: 0 0 var(--spacing-md);
}

.subsection-content {
    font-size: var(--font-size-body);
    letter-spacing: 0;
    color: var(--color-gray-dark);
    opacity: 0.75;
    line-height: 1.25em;
    margin-bottom: var(--spacing-lg);
    text-transform: lowercase;
}

ul.subsection-content {
    list-style: disc;
    padding-left: 1.2em;
}

ul.subsection-content li {
    margin-bottom: 0.25em;
}

ul.subsection-content li:last-child {
    margin-bottom: 0;
}

.price-info {
    font-size: 20px;   /* в 2 раза больше (10×2) */
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-muted);
    background-color: var(--color-bg-overlay);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 10px;
    box-shadow: var(--shadow-medium);
    margin-top: var(--spacing-md);
}

/* Connection Lines — один SVG 1920×1080, пути в абсолютных координатах */
.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
    z-index: 10;
}

.connection-lines .lines-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.line-dot {
    fill: var(--color-gray-light);
}

.line-path {
    fill: none;
    stroke: var(--color-gray-light);
    stroke-width: 1;
    stroke-dasharray: 4 6;
    stroke-linecap: round;
}

/* Footer - left: tg+email+text, right: robot+label */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 1920px;
    height: 120px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 32px 54px;   /* 24 + 30 — иконки/тексты/робот на 30px выше */
    transition: bottom var(--transition-fast);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #00FEC9;
    transition: transform var(--transition-fast);
}

.contact-link:hover {
    transform: scale(1.1);
}

.contact-icon {
    width: 50px;
    height: 50px;
}

.contacts-text {
    font-size: 13px;
    letter-spacing: 0.3em;
    color: var(--color-gray-dark);
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.15em;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-nav-link {
    font-size: 13px;
    letter-spacing: 0.3em;
    color: var(--color-gray-dark);
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.15em;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    transition: color var(--transition-fast);
}

.footer-nav-link:hover {
    color: #00FEC9;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Подпись + закладка робота — один flex-ряд у правого края экрана */
.robot-dock {
    position: absolute;
    right: calc(-1 * var(--frame-letterbox-x, 0px));
    bottom: 54px;
    z-index: 200;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    pointer-events: none;
    transition: filter 0.35s ease;
}

.robot-label {
    font-size: 13px;
    letter-spacing: 0.3em;
    color: var(--color-gray-dark);
    font-family: var(--font-family);
    font-weight: 400;
    text-align: right;
    line-height: 1.15em;
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.22s ease, opacity 0.35s ease-out;
}

.robot-tab {
    flex-shrink: 0;
    box-sizing: border-box;
    background: var(--color-primary);
    border: 0.5px dashed var(--tab-border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 18px;
    box-shadow: var(--shadow-medium);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--color-black);
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
    pointer-events: none;
    text-align: center;
    transform: translateY(calc(100% + 80px));
    transition:
        color 0.2s,
        background 0.2s,
        opacity 0.35s ease,
        visibility 0.35s ease,
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.robot-tab.is-settled {
    transform: translateY(0);
    pointer-events: auto;
}

.robot-tab:hover {
    background: var(--color-primary-hover);
}

.state-chat .robot-tab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + 80px));
}

@media (prefers-reduced-motion: reduce) {
    .robot-tab {
        transform: none;
        pointer-events: auto;
        transition: color 0.2s, background 0.2s;
    }
}

/* Back button — внизу экрана, фиксированная позиция */
.back-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 34px;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100%);
    transition: all var(--transition-fast);
    z-index: 200;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.back-button span {
    font-size: var(--font-size-small);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-black);
}

/* Chat внутри фрейма — Figma Rectangle 1 */
.chat-collapse-btn {
    display: none; /* только мобайл, см. mobile.css */
}

.chat-in-frame-messages {
    flex: 1;
    min-height: 0;
    padding: 24px 24px 12px;
    overflow-y: auto;
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    letter-spacing: 0.05em; /* Уменьшено с 0.12em */
    color: var(--text-primary);
    overscroll-behavior: contain;
    position: relative;
}

.chat-in-frame-input-area {
    flex-shrink: 0;
    padding: 12px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to top, rgba(0, 254, 201, 0.08) 0%, transparent 100%);
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    border-radius: var(--radius-md);
    background: rgba(0, 254, 201, 0.2);
    transition: border-color 0.2s, background 0.2s;
}

.chat-input-bar:focus-within {
    border-color: var(--accent-green);
    background: rgba(0, 254, 201, 0.12);
}

.chat-attach-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.chat-attach-btn:hover {
    background: rgba(0, 254, 201, 0.2);
}

.chat-attach-icon {
    width: 20px;
    height: 20px;
    opacity: 1;
}

.chat-attach-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.chat-send-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0.5px dashed rgba(0, 254, 201, 0.5);
    border-radius: var(--radius-sm);
    background: rgba(0, 254, 201, 0.18);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chat-send-btn:hover {
    background: rgba(0, 254, 201, 0.32);
    border-color: var(--accent-green);
}

.chat-send-btn:active {
    transform: scale(0.96);
}

.chat-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.chat-send-icon {
    width: 20px;
    height: 20px;
}

.chat-in-frame-input-area textarea {
    flex: 1;
    min-height: 44px;
    max-height: 140px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(0, 254, 201, 0.05);
    overflow-y: auto;
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    letter-spacing: 0.05em; /* Уменьшено с 0.12em */
    line-height: 1.15;
    color: var(--text-primary);
    outline: none;
    resize: none;
    caret-color: #4b5563;
}

.chat-in-frame-input-area textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 0.85em;
    transition: opacity 0.3s ease;
}

.chat-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
}

.chat-attachments-preview:empty {
    display: none;
}

.chat-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: var(--font-size-small);
    background: rgba(0, 254, 201, 0.15);
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.chat-attachment-chip-remove {
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: color 0.2s;
}

.chat-attachment-chip-remove:hover {
    color: var(--text-primary);
}

.chat-in-frame-input-area textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 0.85em;
    transition: opacity 0.3s ease;
}

.chat-in-frame-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    max-height: 120px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.3s ease-out, opacity 0.25s ease-out, margin 0.3s ease-out;
}

/* Голосовой ввод */
.chat-voice-area {
    width: 100%;
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

.voice-record-btn {
    flex: 1;
    height: 44px;
    background: rgba(0, 254, 201, 0.1);
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* Кнопка «нажми и говори» (микрофон) убрана — оставляем только
   «голосовой диалог». Скрываем во всех темах и разрешениях. */
.chat-megaphone-btn {
    display: none !important;
}

.chat-megaphone-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.chat-megaphone-btn:hover {
    background: rgba(0, 254, 201, 0.2);
    color: var(--text-primary);
}

.chat-megaphone-btn.recording {
    color: #ff3232;
    background: rgba(255, 50, 50, 0.1);
}

.megaphone-icon {
    width: 20px;
    height: 20px;
}

.mic-icon-inline {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    color: inherit;
    transition: opacity 0.2s;
}

.voice-dialog-mode-btn.recording .mic-icon-inline,
.voice-dialog-mode-btn.thinking .mic-icon-inline {
    opacity: 0;
}

.voice-dialog-mode-btn {
    width: 100%;
    height: 44px;
    background: rgba(0, 254, 201, 0.1);
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
    gap: 8px;
}

.voice-dialog-mode-btn.active {
    background: rgba(0, 254, 201, 0.2);
    border-style: solid;
    border-color: var(--accent-green);
}

.voice-dialog-mode-btn.recording {
    background: rgba(255, 50, 50, 0.1);
    border-color: #ff3232;
}

.voice-dialog-mode-btn.thinking {
    background: rgba(0, 254, 201, 0.3);
    border-color: var(--accent-green);
}

.voice-dialog-mode-btn.speaking {
    background: rgba(0, 254, 201, 0.4);
    border-color: var(--accent-green);
    animation: speaking-pulse 1s infinite;
}

.chat-tts-btn {
    display: none;
}

.chat-megaphone-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.voice-mode-toggle:hover {
    background: rgba(0, 254, 201, 0.15);
    border-color: var(--accent-green);
}

.voice-mode-toggle.active {
    background: rgba(0, 254, 201, 0.25);
    border-style: solid;
    border-color: var(--accent-green);
    color: var(--color-black);
}

.voice-mode-icon {
    width: 20px;
    height: 20px;
}

.voice-mode-active-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.voice-mode-toggle.active .voice-mode-active-dot {
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-green);
}

.voice-mode-toggle.speaking {
    animation: speaking-pulse 1s infinite;
}

@keyframes speaking-pulse {
    0% { background: rgba(0, 254, 201, 0.25); }
    50% { background: rgba(0, 254, 201, 0.5); }
    100% { background: rgba(0, 254, 201, 0.25); }
}

.voice-record-btn:hover {
    background: rgba(0, 254, 201, 0.15);
    border-color: var(--accent-green);
}

.voice-record-btn.recording {
    background: rgba(0, 254, 201, 0.25);
    border-style: solid;
    border-color: var(--accent-green);
}

.voice-btn-text {
    font-family: var(--font-ui);
    font-size: var(--font-size-small);
    letter-spacing: 0.2em;
    color: var(--text-primary);
    text-transform: lowercase;
    transition: opacity 0.2s;
}

.voice-record-btn.recording .voice-btn-text {
    opacity: 0;
}

.voice-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.voice-record-btn.recording .voice-visualizer {
    display: flex;
}

.voice-visualizer span {
    display: block;
    width: 3px;
    height: 10px;
    background: var(--accent-green);
    border-radius: 2px;
    animation: voice-wave 1s ease-in-out infinite;
}

.voice-visualizer span:nth-child(1) { animation-delay: 0.0s; }
.voice-visualizer span:nth-child(2) { animation-delay: 0.1s; }
.voice-visualizer span:nth-child(3) { animation-delay: 0.2s; }
.voice-visualizer span:nth-child(4) { animation-delay: 0.3s; }
.voice-visualizer span:nth-child(5) { animation-delay: 0.4s; }

@keyframes voice-wave {
    0%, 100% { height: 8px; transform: scaleY(1); }
    50% { height: 24px; transform: scaleY(1.2); }
}

.chat-in-frame-input-area.chat-has-input .chat-in-frame-quick-buttons {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.chat-in-frame .quick-btn {
    padding: 6px 10px;
    font-size: var(--font-size-small);
}

.quick-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: rgba(0, 254, 201, 0.12);
    border: 0.5px dashed rgba(0, 254, 201, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    font-weight: 400;
    letter-spacing: 0.05em; /* Уменьшено с 0.12em */
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    background-color: rgba(0, 254, 201, 0.2);
    border-color: var(--accent-green);
}

/* Сообщения чата */
.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 0.5px dashed rgba(0, 254, 201, 0.4);
    font-size: var(--font-size-body);
    line-height: 1.25;
}

.message-text p {
    margin-bottom: 0.5em;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin-bottom: 0.5em;
    padding-left: 1.5em;
}

.message-text li {
    margin-bottom: 0.25em;
}

.message-text strong, .message-text b {
    font-weight: 700;
    color: var(--color-black);
}

.message-user {
    background: rgba(0, 254, 201, 0.2);
    margin-left: 24px;
}

.message-ai {
    background: rgba(255, 255, 255, 0.9);
    margin-right: 24px;
}

.message-system {
    text-align: center;
    font-size: 12px;
    color: var(--color-gray-medium);
    background: transparent;
    margin: 8px 0;
    opacity: 0.8;
    transition: opacity 0.5s ease;
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    margin: 0 2px;
    animation: typing-blink 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* Contacts popup */
.contacts-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: var(--color-white);
    padding: var(--spacing-xl);
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: var(--z-popup);
}

.contacts-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.contact-item a {
    text-decoration: none;
    color: var(--color-black);
    font-size: var(--font-size-body);
    letter-spacing: var(--letter-spacing-tight);
}

.contact-popup-icon {
    width: 50px;
    height: 50px;
}

/* Mobile contacts button - hidden on desktop */
.mobile-contacts-btn {
    display: none;
    position: fixed;
    bottom: var(--mobile-footer-height);
    right: var(--spacing-lg);
    background-color: var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 20px;
    cursor: pointer;
    font-size: var(--font-size-small);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-black);
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-fast);
    z-index: 150;
}

.mobile-contacts-btn:hover {
    transform: scale(1.05);
}

/* Mobile: frame scales down, show mobile contacts button */
@media (max-width: 767px) {
    .contacts {
        display: none;
    }

    .mobile-contacts-btn {
        display: block;
    }
}