/* Палитра презентации к защите (по мотивам autopragmat.ru): тёмные фоны,
   синий и жёлтый акценты, небольшие скругления. */
:root {
    color-scheme: dark;
    --navy: #2C2C2C;
    --navy-soft: #3A3A3A;
    --amber: #FFCC00;
    --blue: #46A6FF;
    --admin: #16283A;
    --terminal: #161616;
    --paper: #1E1E1E;
    --surface: #2C2C2C;
    --line: #3A3A3A;
    --text: #ECECEC;
    --text-muted: #A4A4A4;
    --on-navy: #ECECEC;
    --on-navy-muted: #C8C8C8;
    --on-accent: #1E1E1E;
    --error: #FF8A80;
    --radius: 4px;
    --radius-sm: 2px;
    --font-sans: 'Rubik', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    /* Место под полосу прокрутки не прыгает между длинными и короткими страницами. */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

a { color: inherit; }

code {
    font-family: var(--font-mono);
    font-size: 0.95em;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

.narrow > * { max-width: 720px; }

.muted { color: var(--text-muted); }

/* Шапка */
.site-header {
    background: var(--navy);
    color: var(--on-navy);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}

.logo {
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.logo-mark {
    font-family: var(--font-mono);
    color: var(--amber);
}

/* Чекбокс меню скрыт визуально, но остаётся доступным с клавиатуры. */
.nav-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid var(--navy-soft);
    border-radius: var(--radius);
}

.nav-toggle-input:focus-visible + .nav-toggle { outline: 2px solid var(--blue); }

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

.nav a { text-decoration: none; white-space: nowrap; }

.nav a:hover, .nav a:focus-visible { color: var(--amber); }

.lang-switcher {
    display: inline-flex;
    gap: 4px;
}

.lang-switch {
    font-family: var(--font-mono);
    font-weight: 600;
    border: 1px solid var(--navy-soft);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
}

.lang-switch.is-current {
    background: var(--navy-soft);
    color: var(--text);
}

/* Кнопки */
.button {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

.button-accent, .nav a.button-accent {
    background: var(--amber);
    color: var(--on-accent);
}

.nav a.button-accent:hover, .nav a.button-accent:focus-visible { color: var(--on-accent); }

.button-ghost {
    border: 1px solid var(--on-navy-muted);
    color: var(--on-navy);
}

.button-dark {
    background: var(--blue);
    color: var(--on-accent);
}

/* Первый экран */
.hero {
    background: var(--navy);
    color: var(--on-navy);
    padding: 72px 0 88px;
}

.hero h1 {
    font-size: clamp(36px, 7vw, 64px);
    line-height: 1.1;
    margin: 0 0 20px;
}

.hero .lead {
    max-width: 760px;
    color: var(--on-navy-muted);
    font-size: 19px;
    margin: 0 0 32px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.commands {
    margin: 32px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.commands code {
    color: var(--amber);
    background: var(--navy-soft);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

/* Обычные секции */
.section { padding: 64px 0; }

.section h1 {
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.15;
    margin: 0 0 16px;
}

.eyebrow {
    font-family: var(--font-mono);
    color: var(--blue);
    letter-spacing: 2px;
    margin: 0 0 8px;
}

h2 {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.2;
    margin: 0 0 24px;
}

.h3 {
    font-size: 21px;
    margin: 32px 0 8px;
}

.lead-dark {
    font-size: 19px;
    color: var(--text-muted);
    max-width: 760px;
    margin: 0 0 32px;
}

.section-dark {
    background: var(--navy);
    color: var(--on-navy);
}

.section-dark .muted { color: var(--on-navy-muted); }

/* Карточки функций */
.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.card h3 {
    font-size: 20px;
    margin: 12px 0 8px;
}

.card p {
    margin: 0;
    color: var(--text-muted);
}

.card-icon { font-size: 32px; }

/* «Алматы сейчас» — в стиле приложения «Погода» */
.almaty-now-section { padding-bottom: 0; }

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

.weather {
    color: var(--text);
    background: linear-gradient(160deg, #1F4E7A 0%, #16283A 55%, #1A2230 100%);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.weather-night {
    background: linear-gradient(160deg, #1B2A44 0%, #141C2B 60%, #161616 100%);
}

.weather-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.weather-city {
    margin: 0;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--on-navy-muted);
}

.weather-temp {
    margin: 4px 0 0;
    font-size: clamp(72px, 14vw, 112px);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
}

.weather-condition {
    margin: 8px 0 0;
    font-size: 20px;
    font-weight: 500;
}

.weather-range {
    margin: 4px 0 0;
    color: var(--on-navy-muted);
}

.weather-hero-icon {
    color: var(--amber);
    flex-shrink: 0;
}

.weather-night .weather-hero-icon { color: #C8D3F0; }

.weather-hero-icon-muted { color: var(--on-navy-muted); }

.weather-empty {
    margin: 12px 0 0;
    max-width: 520px;
    color: var(--on-navy-muted);
}

.weather-hours {
    list-style: none;
    margin: 0;
    padding: 16px 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-hour {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.weather-hour-time { color: var(--on-navy-muted); }

.weather-hour:first-child .weather-hour-time {
    color: var(--text);
    font-weight: 600;
}

.weather-hour-temp {
    font-size: 18px;
    font-weight: 500;
}

.weather-tiles {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.weather-tile {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weather-tile dt {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--on-navy-muted);
}

.weather-tile dd { margin: 0; }

.weather-tile-value {
    font-size: 26px;
    font-weight: 400;
    line-height: 1.2;
}

.weather-tile-unit {
    font-size: 15px;
    color: var(--on-navy-muted);
}

.weather-tile-muted {
    font-size: 17px;
    color: var(--on-navy-muted);
}

.aqi-scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin-top: 4px;
}

.aqi-segment {
    height: 4px;
    border-radius: 1px;
    opacity: 0.35;
}

.aqi-segment.is-current {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.aqi-segment-good { background: #50C878; }
.aqi-segment-fair { background: #A8D84E; }
.aqi-segment-moderate { background: var(--amber); }
.aqi-segment-poor { background: #FF8A3D; }
.aqi-segment-veryPoor { background: #FF5E5E; }

.aqi { font-weight: 500; }
.aqi-good, .aqi-fair { color: #9BE3AE; }
.aqi-moderate { color: var(--amber); }
.aqi-poor, .aqi-veryPoor { color: var(--error); }

.weather-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 24px;
    font-size: 14px;
    color: var(--on-navy-muted);
}

.weather-link {
    margin-left: auto;
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.weather-link:hover, .weather-link:focus-visible { text-decoration: underline; }

@media (max-width: 760px) {
    .weather { padding: 20px; }

    .weather-hero-icon .weather-icon { width: 64px; height: 64px; }

    .weather-hours {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 4px;
    }

    .weather-hour { font-size: 13px; gap: 6px; }

    .weather-hour .weather-icon { width: 22px; height: 22px; }

    .weather-hour-temp { font-size: 16px; }

    .weather-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .weather-link { margin-left: 0; }
}

/* «Пульс бота» */
.bot-pulse-section { padding: 12px 0 0; }

.bot-pulse {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    font-size: 15px;
    color: var(--text-muted);
}

.bot-pulse-state {
    color: var(--text);
    font-weight: 500;
}

.bot-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6B6B6B;
    flex-shrink: 0;
}

.bot-pulse.is-online .bot-pulse-dot {
    background: #50C878;
    box-shadow: 0 0 0 4px rgba(80, 200, 120, 0.18);
}

/* «Что нового» */
.whats-new-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: 16px;
}

.whats-new-head h1,
.whats-new-head h2 { margin: 0; }

.whats-new-head p { margin: 0; }

.whats-new-version {
    font-family: var(--font-mono);
    color: var(--amber);
}

.whats-new-note {
    margin: 0 0 16px;
    max-width: 760px;
    font-size: 15px;
    color: var(--text-muted);
}

.whats-new-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.whats-new-row {
    display: grid;
    grid-template-columns: 80px 170px minmax(0, 1fr);
    gap: 4px 16px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.whats-new-date {
    font-size: 14px;
    color: var(--text-muted);
}

.whats-new-row-text {
    margin: 0;
    color: var(--text-muted);
}

.whats-new-all { margin: 16px 0 0; }

.whats-new-row-text strong {
    color: var(--text);
    font-weight: 500;
}

@media (max-width: 760px) {
    .whats-new-row { grid-template-columns: auto minmax(0, 1fr); }

    .whats-new-row-text { grid-column: 1 / -1; }
}

/* Демо-переписка */
.chat {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--terminal);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.bubble {
    margin: 0;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.bubble-user {
    align-self: flex-end;
    background: var(--amber);
    color: var(--on-accent);
    font-family: var(--font-mono);
    font-size: 15px;
}

.bubble-bot {
    align-self: flex-start;
    background: var(--navy-soft);
    color: var(--on-navy);
}

.chat figcaption { font-size: 14px; }

/* Возможности */
.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.feature h2 {
    font-size: 22px;
    margin: 0 0 8px;
}

.feature-admin {
    background: var(--admin);
    color: var(--on-navy);
    border-color: var(--admin);
}

.feature-admin .muted { color: var(--on-navy-muted); }

.badge {
    display: inline-block;
    margin: 0 0 8px;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    background: var(--amber);
    color: var(--on-accent);
    font-size: 14px;
    font-weight: 600;
}

.commands-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.commands-inline code {
    background: var(--line);
    color: var(--text);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.feature-admin .commands-inline code {
    background: var(--paper);
    color: var(--amber);
}

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
}

.faq-item p {
    margin: 12px 0 0;
    color: var(--text-muted);
}

/* Контакты */
.contact-list {
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.contact-row dt { color: var(--text-muted); }

.contact-row dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.contact-row a { color: var(--blue); }

.cta { text-align: left; }

/* Форма заявки */
.request-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label { font-weight: 500; }

.field input[type="text"],
.field select,
.field textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.field textarea { resize: vertical; min-height: 140px; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.field-checkbox input:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}

.field-hint {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

.field-invalid input[type="text"],
.field-invalid select,
.field-invalid textarea { border-color: var(--error); }

.field-error {
    margin: 0;
    font-size: 15px;
    color: var(--error);
}

.field-checkbox {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
}

.field-checkbox input {
    width: 20px;
    height: 20px;
    margin: 3px 0 0;
    accent-color: var(--amber);
}

.field-checkbox label { font-weight: 400; }

.field-checkbox label a { color: var(--blue); }

.field-checkbox .field-error { grid-column: 2; }

.request-form .button {
    align-self: flex-start;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Поле-ловушка убрано за пределы экрана, а не display: none — так его
   заполняют боты, которые пропускают скрытые поля. */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-alert {
    margin: 0 0 24px;
    padding: 12px 16px;
    border-left: 4px solid var(--error);
    background: var(--surface);
    border-radius: var(--radius-sm);
}

/* Подвал */
.site-footer {
    background: var(--terminal);
    color: #8A8A8A;
    padding: 24px 0;
    font-size: 15px;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

/* Узкий экран: меню сворачивается в кнопку. Граница шире телефонной — меню с
   тремя языками и казахскими пунктами в одну строку помещается только от 1000 px. */
@media (max-width: 999px) {
    .nav-toggle { display: inline-block; }

    .nav { display: none; }

    .nav-toggle-input:checked ~ .nav {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        top: 64px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 16px 20px;
        background: var(--navy);
        z-index: 10;
    }

    .nav-toggle-input:checked ~ .nav > a { padding: 10px 0; }

    .nav-toggle-input:checked ~ .nav .lang-switcher { padding: 10px 0; }

    .site-header { position: relative; }
}

/* Телефон */
@media (max-width: 760px) {
    .actions .button { flex: 1 1 100%; }

    .feature-list { grid-template-columns: minmax(0, 1fr); }

    .contact-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }

    .bubble { max-width: 100%; }

    .request-form .button { align-self: stretch; }
}

@media (max-width: 1000px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .cards { grid-template-columns: minmax(0, 1fr); }
}

/* ПК: демо-переписка и призыв в две колонки, единый левый край у всех секций. */
@media (min-width: 1000px) {
    .section-dark .narrow {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 48px;
        align-items: start;
    }

    .section-dark .narrow > * { max-width: none; }

    .cta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 48px;
        align-items: center;
    }

    .cta > h2, .cta > p { grid-column: 1; max-width: 720px; }

    .cta > .button {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}
