/**
 * Слой 3 — примитивы.
 *
 * Ничего не знают ни о теме, ни о содержании страницы. Только токены:
 * литеральный цвет, шрифт, радиус или тень здесь — ошибка, её ловит
 * `php bin/check_landing.php`.
 */

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

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

body.pl-body {
    margin: 0;
    background: var(--surface-page);
    color: var(--ink-body);
    font-family: var(--font-text);
    font-size: var(--step-0);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ── Контейнер и секции ─────────────────────────────────────────────────── */

.pl-container { width: var(--container); margin-inline: auto; }
.pl-container--narrow { width: var(--container-narrow); margin-inline: auto; }

.pl-section {
    position: relative;
    padding-block: var(--section-y);
    isolation: isolate;
}

/* Скины секций. Порядок слоёв снизу вверх: картинка → вуаль → тон → меш.
   Вуаль обязательна везде, где есть картинка, включая тёмную врезку. */
.pl-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-size: cover;
}

.pl-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--paper-texture);
}

.pl-section--plain { background: var(--surface-page); }

.pl-section--tint { background: var(--surface-tint); }
.pl-section--tint::before {
    background-image: linear-gradient(rgba(255, 255, 255, var(--veil-light)), rgba(255, 255, 255, var(--veil-light))), var(--bg-tint);
}
.pl-section--tint::after { background-image: var(--mesh-tint), var(--paper-texture); }

.pl-section--panel { background: var(--surface-panel); }
.pl-section--panel::before {
    background-image: linear-gradient(rgba(255, 255, 255, var(--veil-panel)), rgba(255, 255, 255, var(--veil-panel))), var(--bg-panel);
}

.pl-section--mesh { background: var(--surface-page); }
.pl-section--mesh::before {
    background-image: linear-gradient(rgba(255, 255, 255, var(--veil-light)), rgba(255, 255, 255, var(--veil-light))), var(--bg-hero);
}
.pl-section--mesh::after { background-image: var(--mesh-hero), var(--paper-texture); }

.pl-section--invert { background: var(--surface-invert); color: var(--ink-invert-muted); }
.pl-section--invert::before {
    background-image: linear-gradient(rgba(16, 23, 29, var(--veil-invert)), rgba(16, 23, 29, var(--veil-invert))), var(--bg-invert);
}
.pl-section--invert .pl-h2,
.pl-section--invert .pl-h3,
.pl-section--invert strong { color: var(--ink-invert); }

/* ── Типографика ────────────────────────────────────────────────────────── */

.pl-h1, .pl-h2, .pl-h3 {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    text-transform: var(--display-transform);
    letter-spacing: var(--display-tracking);
    color: var(--ink-strong);
    line-height: 1.08;
    margin: 0;
    /* Ширину чинит minmax(0,1fr) у сетки, здесь — только перенос длинного слова.
       overflow-wrap: anywhere рвал бы заголовки задолго до необходимости. */
    overflow-wrap: break-word;
}

.pl-h1 { font-size: var(--step-6); }
.pl-h2 { font-size: var(--step-4); }
.pl-h3 { font-size: var(--step-2); text-transform: none; letter-spacing: 0; }

.pl-lead {
    font-size: var(--step-1);
    color: var(--ink-body);
    max-width: var(--measure);
    margin: var(--gap-md) 0 0;
}

.pl-text { max-width: var(--measure); margin: var(--gap-sm) 0 0; }
.pl-muted { color: var(--ink-muted); }
.pl-small { font-size: var(--step--1); }
.pl-center { text-align: center; margin-inline: auto; }

/* Лента-указатель под названием раздела — как в шапке печатных прайсов. */
.pl-ribbon {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: var(--gap-xs) var(--gap-lg);
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    box-shadow: var(--shadow-card);
}

.pl-eyebrow {
    display: inline-block;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: var(--step--1);
    color: var(--accent-strong);
    margin-bottom: var(--gap-sm);
}

/* ── Кнопки ─────────────────────────────────────────────────────────────── */

.pl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    min-height: 48px;
    padding: 12px 26px;
    border: 2px solid transparent;
    border-radius: var(--radius-button);
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: var(--display-weight);
    text-transform: var(--display-transform);
    letter-spacing: var(--display-tracking);
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--motion-ease),
                box-shadow var(--motion-base) var(--motion-ease);
}

.pl-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.pl-btn:active { transform: translateY(0); }

.pl-btn--main { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-card); }
.pl-btn--second {
    background: var(--surface-card);
    color: var(--ink-strong);
    border-color: var(--surface-line);
}
.pl-btn--onDark { background: var(--accent); color: var(--accent-ink); }
.pl-btn--wide { width: 100%; }

/* ── Ссылки и фокус ─────────────────────────────────────────────────────── */

.pl-link { color: var(--accent-second); text-underline-offset: .18em; }
.pl-link:hover { color: var(--accent-strong); }

:where(a, button, summary, input, [tabindex]):focus-visible {
    outline: 3px solid var(--accent-second);
    outline-offset: 2px;
    border-radius: var(--radius-field);
}

/* ── Карточки и сетки ───────────────────────────────────────────────────── */

.pl-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-card);
    padding: var(--gap-lg);
    height: 100%;
    box-shadow: var(--shadow-card);
}

.pl-card--flat { box-shadow: none; }

/* minmax(0, 1fr), а не 1fr: иначе минимум колонки считается по самому длинному
   слову, и на 320 пикселях контейнер молча распирает, а текст обрезается. */
.pl-grid { display: grid; gap: var(--gap-md); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) {
    .pl-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pl-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pl-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
    .pl-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pl-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pl-stack { display: flex; flex-direction: column; gap: var(--gap-md); }
.pl-row { display: flex; flex-wrap: wrap; gap: var(--gap-md); align-items: center; }

/* ── Метки, числа, списки ───────────────────────────────────────────────── */

.pl-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    background: var(--accent-second-soft);
    color: var(--accent-second);
    font-size: var(--step--1);
    font-weight: 600;
}

.pl-tag--accent { background: var(--accent-soft); color: var(--accent-strong); }

.pl-num {
    font-family: var(--font-display);
    font-size: var(--step-5);
    font-weight: var(--display-weight);
    color: var(--ink-strong);
    line-height: 1;
    display: block;
}

.pl-list { margin: var(--gap-md) 0 0; padding: 0; list-style: none; }
.pl-list li { position: relative; padding-left: 26px; margin-bottom: var(--gap-sm); }
.pl-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .55em;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--accent);
}

/* ── Раскрывашки ────────────────────────────────────────────────────────── */

.pl-details {
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-card);
    background: var(--surface-card);
    padding: var(--gap-md) var(--gap-lg);
}

.pl-details + .pl-details { margin-top: var(--gap-sm); }

.pl-details > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-strong);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: var(--gap-md);
    min-height: 32px;
    align-items: center;
}

.pl-details > summary::-webkit-details-marker { display: none; }
.pl-details > summary::after {
    content: "+";
    font-family: var(--font-display);
    font-size: var(--step-2);
    color: var(--accent-strong);
    line-height: 1;
}
.pl-details[open] > summary::after { content: "–"; }

/* ── Прокручиваемые ленты и таблицы ─────────────────────────────────────── */

/* Широкая таблица обязана прокручиваться внутри своей коробки: иначе она
   распирает секцию, и виноватым выглядит соседний блок. */
.pl-scroll { overflow-x: auto; scroll-padding-inline: var(--gap-md); }

.pl-table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.pl-table th, .pl-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--surface-line); }
.pl-table th { font-family: var(--font-display); font-weight: 600; color: var(--ink-muted); font-size: var(--step--1); text-transform: uppercase; }
.pl-table td.pl-num-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Появление при прокрутке ────────────────────────────────────────────── */

/* Прячем ТОЛЬКО под классом .js и со страховкой по таймауту: без скрипта
   (и у поисковика) секция обязана остаться видимой. */
.js .pl-reveal { opacity: 0; transform: translateY(14px); }
.js .pl-reveal.is-in,
.js.pl-reveal-off .pl-reveal {
    opacity: 1;
    transform: none;
    transition: opacity var(--motion-slow) var(--motion-ease), transform var(--motion-slow) var(--motion-ease);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
    .js .pl-reveal { opacity: 1; transform: none; }
}

/* Атрибут hidden обязан побеждать раскладку: у класса с display и у [hidden]
   одинаковая специфичность, и правило класса идёт позже. */
[hidden] { display: none !important; }
