/*
 * Бинарность — стили отдельных страниц: услуги, серверы и тарифы, магазин модулей,
 * специалисты, кейсы, блог, контакты, документы, ошибки.
 */

/* ---------- Сетка без «рваных» рядов ---------- */
/* Три колонки; если в последнем ряду остаётся одна карточка — она растягивается на всю ширину,
   если две — делят ряд пополам. */
@media (min-width: 1041px) {
  .grid--fill { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid--fill > * { grid-column: span 2; }
  .grid--fill > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
  .grid--fill > :nth-last-child(2):nth-child(3n + 1),
  .grid--fill > :last-child:nth-child(3n + 2) { grid-column: span 3; }

  /* одинокая карточка услуги на всю ширину — в две колонки: описание слева, «что входит» справа */
  .grid--fill > .svc:last-child:nth-child(3n + 1) { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); column-gap: clamp(32px, 5vw, 72px); row-gap: 12px; grid-template-areas: "top feats" "title feats" "text feats" "foot foot"; align-content: start; }
  .grid--fill > .svc:last-child:nth-child(3n + 1) .svc__top { grid-area: top; }
  .grid--fill > .svc:last-child:nth-child(3n + 1) .svc__title { grid-area: title; }
  .grid--fill > .svc:last-child:nth-child(3n + 1) .svc__text { grid-area: text; }
  .grid--fill > .svc:last-child:nth-child(3n + 1) .svc__feats { grid-area: feats; align-self: center; }
  .grid--fill > .svc:last-child:nth-child(3n + 1) .svc__foot { grid-area: foot; }
}
@media (min-width: 681px) and (max-width: 1040px) {
  .grid--fill > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- Боковая колонка ---------- */
/* minmax(0, 1fr): колонку не распирают широкие таблицы и блоки кода внутри — они прокручиваются сами. */
.aside-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; }
@media (min-width: 941px) { .aside-stack--sticky { position: sticky; top: calc(var(--header-h) + 24px); } }

.linklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.linklist--col { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.linklist__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 15px; font-weight: 600; transition: border-color .15s, background-color .15s, transform .2s var(--ease); }
.linklist__item > .icon { margin-left: auto; color: var(--ink-3); transition: color .15s, transform .2s var(--ease); }
.linklist__item:hover { border-color: var(--accent-line); }
.linklist__item:hover > .icon { color: var(--accent-text); transform: translate(2px, -2px); }
.linklist--col .linklist__item { border-color: transparent; background: none; padding: 9px 8px; margin-inline: -8px; font-size: 14.5px; }
.linklist--col .linklist__item:hover { background: var(--surface-2); border-color: transparent; }

.footnote { margin-top: 18px; font-size: 13px; line-height: 1.65; color: var(--ink-3); max-width: 96ch; }

/* показатели справа в шапке страницы */
.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: oklch(1 0 0 / .035); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; }
.hero-facts > div { display: flex; flex-direction: column-reverse; gap: 6px; padding: 22px 24px; }
.hero-facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
.hero-facts > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
.hero-facts dd { font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.hero-facts dd small { font-size: .45em; font-weight: 600; letter-spacing: 0; color: var(--ink-3); }
.hero-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Простая карточка-преимущество ---------- */
.feature { gap: 12px; }
.feature p { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.feature .icon-tile { margin-bottom: 6px; }
.feature__no { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-text); margin-bottom: 4px; }

/* ---------- Серверы: таблица тарифов ---------- */
.ptable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.ptable { width: 100%; min-width: 820px; font-size: 15px; }
.ptable th, .ptable td { padding: 16px 20px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--line); }
.ptable tbody th, .ptable thead th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface); border-right: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--ink-3); white-space: nowrap; }
.ptable thead th { padding-top: 24px; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); border-bottom-color: var(--line-2); }
.ptable__cap { display: block; margin-bottom: 7px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ptable .is-hl { background: var(--accent-soft); }
.ptable thead .is-hl { box-shadow: inset 0 3px 0 var(--accent); }
.ptable__price { display: block; font-size: clamp(22px, 2.3vw, 28px); font-weight: 700; letter-spacing: -0.03em; white-space: nowrap; }
.ptable__price small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .04em; color: var(--ink-3); }
.ptable .is-mut { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.ptable__yes { display: inline-block; color: var(--ok-text); }
.ptable tbody tr:last-child th, .ptable tbody tr:last-child td { border-bottom: 0; padding-block: 20px; }
.scroll-hint { display: none; margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); text-align: center; }
@media (max-width: 900px) {
  .scroll-hint { display: block; }
  .ptable { min-width: 700px; font-size: 14px; }
  .ptable th, .ptable td { padding: 13px 14px; }
  .ptable tbody th, .ptable thead th:first-child { white-space: normal; max-width: 140px; line-height: 1.4; }
}

/* конфигурации серверов */
.hw { gap: 0; }
.hw__name { margin-top: 10px; font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.hw__price { margin-top: 14px; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.hw__price span { font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; }
.hw__specs { margin-top: 20px; display: grid; }
.hw__specs > div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.hw__specs dt { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.hw__specs dd { font-weight: 600; }
.hw__note { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-3); }

/* расчёт пакета */
.calc { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.calc__head { padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.calc__row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.calc__row small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.calc__sum { font-weight: 700; white-space: nowrap; text-align: right; }
.calc__sum s { font-weight: 400; color: var(--ink-3); margin-right: 6px; }
.calc__sum em { font-style: normal; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ok-text); margin-left: 4px; }
.calc__row--total { border-bottom: 0; background: var(--accent-soft); font-weight: 700; padding-block: 22px; }
.calc__row--total .calc__sum { font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -0.03em; color: var(--accent-text); }
/* На телефоне сумма уходит под название строки — иначе цена со скидкой не помещается рядом. */
@media (max-width: 520px) {
  .calc__row:not(.calc__row--total) { flex-direction: column; align-items: stretch; gap: 8px; }
  .calc__row:not(.calc__row--total) .calc__sum { text-align: left; }
  .calc__head, .calc__row { padding-inline: 18px; }
}

/* границы тарифа */
.scope { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 20px; padding: clamp(24px, 3vw, 36px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.excl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.excl li { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.excl li::before { content: "+"; flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); font-family: var(--font-mono); font-size: 13px; line-height: 1; }
@media (max-width: 860px) { .scope { grid-template-columns: minmax(0, 1fr); } .excl { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Магазин модулей ---------- */
.filters { display: grid; gap: 14px; margin-bottom: clamp(24px, 3vw, 36px); }
.empty { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.empty__art { position: relative; min-height: 260px; background: var(--night); }
.empty__art .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.empty__body { display: grid; gap: 14px; justify-items: start; align-content: center; padding: clamp(24px, 4vw, 48px); }
@media (max-width: 760px) { .empty { grid-template-columns: minmax(0, 1fr); } .empty__art { min-height: 160px; } }

.ext-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 4vw, 52px); min-width: 0; align-content: start; }
.ext-cover { position: relative; aspect-ratio: 16 / 7; border-radius: var(--r-lg); overflow: hidden; background: var(--night); border: 1px solid var(--line); }
.ext-cover img, .ext-cover .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.buy { display: grid; gap: 14px; }
.buy__price { font-size: clamp(32px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.buy__price--free { color: var(--ok-text); }
.buy__note { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); margin-top: -4px; }
.buy__hint { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.buy__specs { display: grid; margin-top: 6px; }
.buy__specs > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.buy__specs dt { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); padding-top: 1px; }
.buy__specs dd { font-weight: 500; line-height: 1.45; }
.buy__links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; }

.changelog { display: grid; gap: 0; margin-top: 16px; border-left: 1px solid var(--line-2); }
.changelog > li { position: relative; padding: 0 0 24px 26px; }
.changelog > li:last-child { padding-bottom: 0; }
.changelog > li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.changelog__ver { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.changelog ul { display: grid; gap: 5px; margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.changelog ul li { position: relative; padding-left: 16px; }
.changelog ul li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); }

/* ---------- Специалист ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head__id { display: grid; gap: 10px; }
.profile-head__name { font-size: 15px; color: var(--ink-2); margin-bottom: -10px; }
.profile-head__focus { font-family: var(--font-mono); font-size: 14px; color: var(--accent-text); margin-top: -8px; }
.profile-head__rate { align-self: center; font-family: var(--font-mono); font-size: 14px; color: var(--ink-2); }
.stackwin__list { display: grid; padding: 10px 0 14px; font-family: var(--font-mono); font-size: 13.5px; }
.stackwin__list li { display: flex; align-items: center; gap: 16px; padding: 8px 20px; color: oklch(0.88 0.012 264); }
.stackwin__list li:hover { background: oklch(1 0 0 / .04); }
.stackwin__no { color: oklch(0.52 0.03 264); font-size: 11.5px; }
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.skills li { position: relative; padding: 13px 16px 13px 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 15px; line-height: 1.4; }
.skills li::before { content: ""; position: absolute; left: 16px; top: 19px; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
@media (max-width: 640px) { .skills { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Кейс ---------- */
.case-top { padding-bottom: clamp(28px, 4vw, 48px); }
.case-shot .browser { height: auto; border-radius: 14px; border-bottom: 1px solid var(--line-2); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(24px, 3vw, 40px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.facts > div { padding: 20px 24px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin-top: 8px; font-size: 15.5px; font-weight: 600; line-height: 1.4; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts > div:nth-child(2n) { border-right: 0; } .facts > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); } }
.metrics--stack { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
.metrics--stack .metric:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------- Статья ---------- */
.article { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: clamp(32px, 5vw, 72px); justify-content: center; align-items: start; }
.article__toc { position: sticky; top: calc(var(--header-h) + 24px); }
.toc__title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; line-height: 1.4; color: var(--ink-2); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--accent-text); border-left-color: var(--accent-text); }
.article__body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 3.5vw, 44px); }
.article__cover { position: relative; aspect-ratio: 16 / 7; border-radius: var(--r-lg); overflow: hidden; background: var(--night); }
.article__cover img, .article__cover .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article__body .prose { max-width: none; }
.author { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.author > div { flex: 1; min-width: 220px; }
.author__name { font-weight: 700; margin-bottom: 4px; }
@media (max-width: 1040px) { .article { grid-template-columns: minmax(0, 760px); } .article__toc { position: static; } .article__toc:empty { display: none; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: clamp(32px, 4vw, 52px); flex-wrap: wrap; }
.pager__pages { display: flex; gap: 6px; }
.pager__page, .pager__nav { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 42px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600; color: var(--ink-2); transition: border-color .15s, color .15s, background-color .15s; }
.pager__page:hover, .pager__nav:hover { border-color: var(--accent-text); color: var(--accent-text); }
.pager__page.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- О компании: окно с журналом ---------- */
.logwin__body { padding: 20px 22px 22px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.95; color: oklch(0.84 0.014 264); overflow-x: auto; }
.logwin__body > div { white-space: nowrap; }
.logwin__body .gap { height: 12px; }
.logwin__body .t, .logwin__body .c { color: oklch(0.54 0.03 264); }
.logwin__body .g { color: oklch(0.8 0.17 152); font-weight: 700; }
.logwin__body .y { color: oklch(0.84 0.14 85); font-weight: 700; }
.logwin__body .r { color: oklch(0.72 0.19 25); font-weight: 700; }
.logwin__body .b { color: oklch(0.76 0.14 250); font-weight: 700; }

/* ---------- Контакты ---------- */
.contact-cards { margin-top: 14px; }
.contact-card { gap: 6px; }
.contact-card .icon-tile { margin-bottom: 12px; }
.contact-card__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.contact-card__value { font-size: clamp(18px, 1.8vw, 22px); font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.contact-card__note { font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.fold { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; cursor: pointer; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .icon { color: var(--accent-text); transition: transform .2s; }
.fold[open] > summary .icon { transform: rotate(180deg); }
.fold .kv { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.place { flex-direction: row; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.place__grid { position: relative; flex: none; width: 132px; background-color: var(--surface-2); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 22px 22px; border-right: 1px solid var(--line); }
.place__pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 0 0 8px color-mix(in oklch, var(--accent) 18%, transparent), var(--shadow-accent); }
.place__body { display: grid; gap: 6px; padding: 20px 22px; }
.place__city { font-weight: 700; font-size: 17px; }
.place__addr { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.place .link { margin-top: 6px; font-size: 14.5px; }

/* ---------- Документы ---------- */
.legal-nav { margin-bottom: clamp(28px, 4vw, 44px); }
.legal { max-width: none; }
.legal h2 { font-size: 21px; }
.legal h3 { font-size: 17px; }
.legal table { font-size: 14px; }

/* ---------- Страницы ошибок ---------- */
.errpage { min-height: min(72vh, 720px); display: grid; align-items: center; }
.errpage__code { display: flex; gap: clamp(10px, 1.6vw, 22px); font-family: var(--font-mono); font-size: clamp(72px, 13vw, 176px); font-weight: 700; line-height: .9; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1.5px var(--line-2); margin-bottom: 6px; }
.errpage__zero { color: var(--accent-text); -webkit-text-stroke: 0; text-shadow: 0 0 60px oklch(0.6 0.2 262 / .7); animation: blink 2.4s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .errpage__zero { animation: none; } }
