/* Сетка, контейнеры, шапка, подвал. Оформление секций — в sections.css */

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: var(--gap) 0; }
/* Липкая шапка не должна накрывать заголовок при переходе по якорю */
.section[id], .hero[id] { scroll-margin-top: 76px; }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--bg-deep); color: rgba(255, 255, 255, .72); }
.section--deep h2, .section--deep h3 { color: #fff; }

.section__head { max-width: 720px; margin-bottom: clamp(36px, 4vw, 52px); }
.section__lead {
    margin-top: 18px;
    font-size: clamp(17px, 1.6vw, 19px);
    color: var(--ink-muted);
}
.section--deep .section__lead { color: rgba(255, 255, 255, .62); }

/* Сетки */

.grid { display: grid; gap: 24px; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
    /* ⚠️Элемент сетки по умолчанию не сжимается меньше своего содержимого:
       длинное слово распирало колонку и давало прокрутку вбок на ~1000px. */
    min-width: 0;
    overflow-wrap: break-word;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
}
.section--alt .card { background: #fff; }

/* Шапка */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
}

.header__logo {
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    letter-spacing: -.01em;
    white-space: nowrap;
}
.header__logo:hover { color: var(--ink); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__link {
    font-size: 16px;
    color: var(--ink-soft);
    font-weight: 500;
}
.nav__link:hover { color: var(--accent); }

.header__cta { padding: 11px 20px; font-size: 15px; }

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

/* Подвал */

.footer {
    padding: 48px 0;
    background: var(--bg-deep);
    color: rgba(255, 255, 255, .5);
    font-size: 15px;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer__links a { color: rgba(255, 255, 255, .72); }
.footer__links a:hover { color: #fff; }
.footer__note { max-width: 460px; }

/* Адаптив */

@media (max-width: 900px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }

    .nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 24px 20px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .nav[hidden] { display: none; }
    .nav__link {
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        font-size: 17px;
    }
    .nav__cta { margin-top: 16px; }
    .header__cta--desktop { display: none; }
}

@media (max-width: 620px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .card { padding: 24px; }
    .wrap { padding: 0 18px; }
}
