/* Проект 02 — базовые стили.
   Направление: минимализм, чёрное/белое, акцентный бордовый для рукописных заметок. */

:root {
    --bg: #ffffff;
    --fg: #131313;
    --muted: #5b5b5b;
    --line: #e6e6e6;
    --accent: #7b1f2b;        /* бордовый */
    --accent-weak: #f4ebec;
    --max-width: 1080px;
    --space: 24px;
    --radius: 4px;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
}

a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
}

a:hover {
    color: var(--accent);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

/* --- Демо-пометка (только локальные демо-документы public/docs; на лендинге убрана) --- */
.demo-banner {
    margin: 0;
    padding: 10px var(--space);
    background: var(--accent-weak);
    color: var(--accent);
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    font-size: 14px;
    text-align: center;
}

/* --- Шапка --- */
.site-header {
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    border-bottom: none;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 15px;
}

.nav a {
    border-bottom: none;
    color: var(--muted);
}

.nav a:hover {
    color: var(--accent);
}

/* --- Hero --- */
.hero {
    padding: 64px 0 48px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 16px;
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.15;
    font-weight: 600;
    max-width: 20ch;
}

.hero-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    max-width: 56ch;
}

.handwritten {
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    color: var(--accent);
}

.hero-note {
    margin: 12px 0 0;
    font-size: 16px;
}

/* Рукописная бордовая подпись секции — тот же авторский приём, что и подпись
   под кнопкой первого экрана (класс .handwritten): тот же шрифт, начертание,
   цвет и размерная стилистика. Здесь задаются только размер и расположение
   под обычным подзаголовком секции. */
.section-note {
    margin: 0 0 28px;
    font-size: 16px;
    max-width: 56ch;
}

/* Подпись прижимается к своему подзаголовку, когда идёт сразу за ним;
   в остальных случаях отступ остаётся обычным. */
.section-subtitle:has(+ .section-note),
.hero-subtitle:has(+ .section-note) {
    margin-bottom: 6px;
}

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid var(--fg);
    border-radius: var(--radius);
    font-size: 16px;
    cursor: pointer;
}

.btn-primary {
    background: var(--fg);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Секции --- */
.section {
    padding: 48px 0;
}

.section-alt {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 600;
}

.section-subtitle {
    margin: 0 0 28px;
    color: var(--muted);
}

/* --- Продукт --- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.product-title {
    margin: 0 0 12px;
    font-size: 20px;
}

.product-description {
    margin: 0;
    color: var(--muted);
    max-width: 60ch;
}

.product-audience {
    margin: 12px 0 0;
    color: var(--muted);
    max-width: 60ch;
}

.specs {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.spec {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.spec dt {
    min-width: 180px;
    color: var(--muted);
}

.spec dd {
    margin: 0;
}

/* --- Карточки вариантов --- */
.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

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

.card-title {
    margin: 0 0 8px;
    font-size: 19px;
}

.card-description {
    margin: 0 0 12px;
    color: var(--muted);
}

.card-list {
    margin: 0 0 16px;
    padding-left: 18px;
    color: var(--muted);
}

.card-price {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.price-undefined {
    color: var(--accent);
    font-family: "Segoe Script", "Bradley Hand", cursive;
    font-weight: 400;
}

/* --- FAQ --- */
.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}

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

.faq-item p {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 64ch;
}

/* --- Контакты --- */
.contacts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

/* --- Подвал --- */
.site-footer {
    margin-top: 48px;
    border-top: 1px solid var(--line);
    padding: 32px 0;
    color: var(--muted);
    font-size: 14px;
}

.footer-legal {
    color: var(--fg);
    font-weight: 600;
}

.footer-placeholder {
    font-style: italic;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.footer-copy {
    margin-top: 16px;
}

/* --- Страница ошибки --- */
.error-page {
    padding: 96px 0;
}

.error-title {
    font-size: 32px;
}

.error-message {
    color: var(--muted);
}

/* --- Форма заказа и результат (этап 4.2) --- */
.order-blocked {
    color: var(--muted);
    background: var(--accent-weak);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.order-form {
    display: grid;
    gap: 16px;
    max-width: 560px;
}

.order-field {
    display: grid;
    gap: 6px;
}

.order-label {
    font-size: 14px;
    color: var(--muted);
}

.order-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: var(--bg);
    color: var(--fg);
}

.order-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.45;
}

.order-consent input {
    margin-top: 3px;
}

.card-cta {
    margin: 12px 0 0;
}

.order-result {
    max-width: 640px;
    padding: 64px var(--space);
}

.order-result-title {
    font-size: 28px;
}

.order-result-message {
    color: var(--muted);
}

/* --- Преимущества --- */
.benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.benefit-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.benefit-text {
    margin: 0;
    color: var(--muted);
    max-width: 52ch;
}

/* --- Сравнение комплектаций --- */
.compare-wrap {
    overflow-x: auto;
}

.compare {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.compare th,
.compare td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.compare thead th {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.compare tbody th {
    font-weight: 400;
    color: var(--fg);
}

/* --- Как это работает --- */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.step {
    display: flex;
    gap: 16px;
}

.step-number {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--accent);
    /* Неровный контур «от руки» вместо ровной окружности. */
    border-radius: 47% 53% 52% 48% / 54% 46% 56% 44%;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
    transform: rotate(-4deg);
}

.step-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.step-text {
    margin: 0;
    color: var(--muted);
    max-width: 56ch;
}

/* --- Подвал: демо-пометка --- */
.footer-demo {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-style: italic;
}

/* --- Кнопка «Наверх» --- */
/* Компактная неброская кнопка в углу: не выглядит как основная CTA,
   использует базовую палитру (нейтральный контур/иконка; бордовый — только
   при наведении, как у ссылок навигации). Рукописный шрифт не используется. */
.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(19, 19, 19, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    /* visibility задерживается на время затухания, чтобы скрытие было плавным. */
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Доступность --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Адаптивность --- */
@media (min-width: 720px) {
    .product-grid {
        grid-template-columns: 3fr 2fr;
    }

    .cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .benefits {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }

    .to-top {
        transition: none;
    }
}
