/* REC: TACTICAL — secondary pages: news (news.html), documents (legal.html), 404 */

/* ================= NEWS: list ================= */
.news-page { padding-top: 8px; }
.news-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 28px; }
.news-bar__sub .icon { width: 16px; height: 16px; }
@media (hover: hover) { .news-bar__sub:hover .icon { transform: none; } }
.news-grid--all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.news-grid--all .ncard__media { height: auto; aspect-ratio: 16 / 9; }
.news-grid--all .ncard--feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.news-grid--all .ncard--feature .ncard__media { aspect-ratio: auto; min-height: 360px; height: 100%; border-radius: 9px 0 0 9px; }
.news-grid--all .ncard--feature .ncard__body { align-content: center; gap: 14px; padding: 40px 44px; }
.news-grid--all .ncard--feature .ncard__title { font-family: var(--font-osd); font-size: clamp(24px, 2.2vw, 32px); font-weight: 400; line-height: 1.08; letter-spacing: .02em; text-transform: uppercase; color: #fff; -webkit-text-stroke: .4px currentColor; }
.news-grid--all .ncard--feature .ncard__excerpt { font-size: 15px; -webkit-line-clamp: 4; }
.news-page .empty.panel { padding: 56px 24px; }
/* «Показать ещё»: how much of the archive is on screen, and the button for the next three rows */
.news-more { display: grid; justify-items: center; gap: 14px; margin-top: 40px; }
.news-more__count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.news-more .btn { min-width: 200px; }
.news-hero .scene__media { object-position: 50% 0; } /* the top of the shot under the header, as on «Наборы» */

/* ================= NEWS: article ================= */
.is-article .news-hero { padding-bottom: 56px; min-height: min(78svh, 680px); display: flex; align-items: flex-end; }
.is-article .news-hero .page-hero__inner { width: 100%; }
.is-article .news-hero .scene__media { object-position: 50% 40%; }
.is-article .news-hero .scene__fade {
  background:
    linear-gradient(90deg, rgba(6, 7, 9, 0.9) 0%, rgba(6, 7, 9, 0.55) 55%, rgba(6, 7, 9, 0.2) 100%),
    linear-gradient(to bottom, rgba(7, 8, 10, 0.55) 0%, transparent 30%, rgba(7, 8, 10, 0.4) 62%, var(--bg) 100%);
}
/* back to the list: a square viewfinder button — corner brackets, an arrow, the label in a tooltip */
.news-back {
  --hud-c: rgba(255, 255, 255, 0.6); --hud-len: 8px; --hud-w: 1.5px;
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0;
  background: rgba(5, 6, 8, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--text-2); transition: color var(--t) ease, border-color var(--t) ease, background-color var(--t) ease;
}
.news-back::before { filter: none; }
.news-back .icon { width: 18px; height: 18px; }
.news-back:focus-visible { outline-offset: 4px; }
@media (hover: hover) { .news-back:hover { --hud-c: #fff; color: #fff; border-color: rgba(255, 255, 255, 0.2); background: rgba(5, 6, 8, 0.6); } }
.news-head__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 28px; }
.news-head__meta .badge { background: rgba(5, 6, 8, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.news-head__meta .ncard__meta { color: var(--text-2); }
.news-head__title { max-width: 980px; margin-top: 18px; color: #fff; text-shadow: var(--title-shadow); }
.is-article .page-hero__lead { max-width: 720px; }

.article { display: grid; grid-template-columns: minmax(0, 720px) minmax(220px, 280px); justify-content: space-between; gap: 48px; }
/* align-self: start — a stretched grid item has no room to stick */
.article__aside { display: grid; gap: 12px; align-content: start; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); }
.article__card { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-4); background: #0b0d10; }
.article__label { font-family: var(--font-osd); font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.article__share { display: flex; gap: 8px; }
.article__share .icon-btn { width: 42px; height: 42px; }
.article__discuss { grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; transition: border-color var(--t) ease, background-color var(--t) ease; }
@media (hover: hover) { .article__discuss:hover { border-color: var(--line-3); background: #0d1014; } }
.article__discuss > .icon:first-child { width: 22px; height: 22px; color: #c9cdf5; }
.article__discuss b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.article__discuss small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.article__discuss > .icon:last-child { color: var(--text-3); }

/* long-form text */
.prose { font-size: 16.5px; line-height: 1.75; color: var(--text-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-family: var(--font-osd); font-size: 22px; font-weight: 400; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase; color: #fff; -webkit-text-stroke: .4px currentColor; }
.prose h2 + * { margin-top: .7em; }
.prose h3 { margin-top: 1.6em; font-size: 17px; font-weight: 600; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { display: grid; gap: .5em; padding-left: 0; }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 10px; height: 2px; background: var(--text-3); }
.prose ol { counter-reset: n; }
.prose ol li { position: relative; padding-left: 34px; counter-increment: n; }
.prose ol li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .1em; font-family: var(--font-osd); font-size: 14px; color: var(--text-3); }
.prose a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 3px; transition: text-decoration-color var(--t) ease; }
@media (hover: hover) { .prose a:hover { text-decoration-color: #fff; } }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 2px solid var(--line-3); color: var(--text); font-style: italic; }
/* article pictures keep their own shape: a wide shot fills the column, a phone screenshot stays within the screen
   height, a small picture is not blown up (centred); the caption takes the picture's width, not the column's */
.prose figure { width: fit-content; max-width: 100%; margin-inline: auto; }
.prose figure img { display: block; max-width: 100%; height: auto; max-height: min(78vh, 760px); border-radius: var(--r-4); border: 1px solid var(--line); }
.prose figcaption { width: 0; min-width: 100%; margin-top: 10px; font-size: 13px; color: var(--text-3); }

.news-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.news-nav__link { display: grid; gap: 8px; align-content: start; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-4); background: #0b0d10; transition: border-color var(--t) ease, background-color var(--t) ease; }
@media (hover: hover) { .news-nav__link:hover { border-color: var(--line-3); background: #0d1014; } }
.news-nav__link--next { text-align: right; justify-items: end; }
.news-nav__dir { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-osd); font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.news-nav__link--next .news-nav__dir { flex-direction: row-reverse; }
.news-nav__link b { font-size: 15.5px; font-weight: 600; line-height: 1.4; color: var(--text); }
.news-related { margin-top: 72px; }
.news-related .divider-title { margin-bottom: 32px; }
.news-grid--related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.news-grid--related .ncard__media { height: auto; aspect-ratio: 16 / 9; }
.news-missing { padding: 64px 24px; }

/* reading progress (scroll-driven, no JS) */
.is-article .site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #e8eaed;
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .is-article .site-header::after { animation: read-progress linear both; animation-timeline: scroll(root); }
}
@keyframes read-progress { to { transform: scaleX(1); } }

/* ================= LEGAL ================= */
/* see-through at rest (the hero photo dissolves behind it), glass once stuck under the header (.is-stuck — legal.js) */
.legal-tabs { position: sticky; top: var(--header-h); z-index: 20; margin-bottom: 40px; transition: background-color .2s ease; }
.legal-tabs.is-stuck { background: var(--bg-glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.legal-tabs .tab { display: inline-flex; align-items: center; gap: 9px; height: 52px; font-size: 15px; }
.legal-tabs .tab .icon { width: 16px; height: 16px; color: var(--text-3); transition: color var(--t) ease; }
.legal-tabs .tab[aria-selected="true"] .icon { color: #fff; }
.legal { display: grid; grid-template-columns: 260px minmax(0, 760px); justify-content: start; gap: clamp(56px, 6vw, 96px); }
.legal__toc { position: sticky; top: calc(var(--header-h) + 52px + 28px); align-self: start; display: grid; gap: 16px; }
.legal__toc-box { display: grid; gap: 16px; }
.legal__toc-box > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; pointer-events: none; }
.legal__toc-box > summary::-webkit-details-marker { display: none; }
.legal__toc-box > summary .icon { display: none; transition: transform var(--t) var(--ease); }
.legal__toc-box[open] > summary .icon { transform: rotate(180deg); }
.tab__short { display: none; }
.legal__toc-title { font-family: var(--font-osd); font-size: 12px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.legal__toc ol { display: grid; gap: 2px; counter-reset: s; }
.legal__toc ol a { position: relative; display: block; padding: 7px 12px 7px 40px; border-radius: var(--r-2); font-size: 14px; line-height: 1.4; color: var(--text-3); counter-increment: s; transition: color var(--t) ease, background-color var(--t) ease; }
.legal__toc ol a::before { content: counter(s, decimal-leading-zero); position: absolute; left: 12px; top: 8px; font-family: var(--font-osd); font-size: 12.5px; color: var(--text-4); }
@media (hover: hover) { .legal__toc ol a:hover { color: var(--text); } }
.legal__toc ol a[aria-current="true"] { color: #fff; background: rgba(255, 255, 255, 0.05); }
.legal__toc ol a[aria-current="true"]::before { color: var(--text-2); }
.legal__meta { display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--text-4); }
.legal__meta a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
@media (hover: hover) { .legal__meta a:hover { color: #fff; } }
.legal__doc-head { display: grid; gap: 10px; margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.legal__doc-title { font-family: var(--font-osd); font-size: clamp(26px, 2.6vw, 34px); font-weight: 400; line-height: 1.05; letter-spacing: .03em; text-transform: uppercase; color: #fff; -webkit-text-stroke: .5px currentColor; }
.legal__updated { font-size: 13.5px; color: var(--text-3); }
.legal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.legal__sec { scroll-margin-top: 64px; } /* sticky doc tabs (52px) + 12px, on top of html scroll-padding (header + 12px) */
.legal__sec + .legal__sec { margin-top: 44px; }
.legal__sec > * + * { margin-top: .9em; }
.legal__sec > h2 { display: flex; gap: 14px; align-items: baseline; margin-top: 0; }
.legal__sec > h2 + * { margin-top: .8em; }
.legal__sec h2 span { flex: none; font-size: 15px; color: var(--text-4); -webkit-text-stroke: 0; }
.legal .prose { font-size: 15.5px; line-height: 1.7; }
.legal .note { margin-bottom: 28px; }

/* ================= 404 ================= */
.nosignal { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 100svh; padding: calc(var(--header-h) + 40px) var(--gutter) 64px; overflow: hidden; text-align: center; }
.nosignal__static { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: .16; image-rendering: pixelated; }
.nosignal::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 60% at 50% 45%, transparent 0%, rgba(7, 8, 10, 0.75) 70%, var(--bg) 100%), repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px); }
.nosignal .cam { position: absolute; inset: calc(var(--header-h) + 20px) var(--gutter) 24px; width: auto; height: auto; }
.nosignal__inner { display: grid; justify-items: center; gap: 18px; max-width: 640px; }
.nosignal__code { font-family: var(--font-osd); font-size: clamp(88px, 16vw, 180px); line-height: .9; letter-spacing: .04em; color: #fff; -webkit-text-stroke: 1px currentColor; text-shadow: 3px 0 rgba(224, 55, 43, 0.55), -3px 0 rgba(120, 200, 255, 0.4); animation: ns-jitter 3.2s steps(1) infinite; }
.nosignal__title { font-family: var(--font-osd); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.nosignal__text { max-width: 460px; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.nosignal__path { max-width: 100%; padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: var(--r-2); font-family: var(--font-osd); font-size: 13px; letter-spacing: .06em; color: var(--text-3); overflow-wrap: anywhere; }
.nosignal__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
@keyframes ns-jitter { 0%, 100% { transform: none; } 47% { transform: translateX(2px) skewX(-2deg); } 48% { transform: translateX(-3px); } 49% { transform: none; } 82% { transform: translateY(1px); clip-path: inset(0 0 45% 0); } 83% { transform: none; clip-path: none; } }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .news-grid--all, .news-grid--related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid--all .ncard--feature { grid-template-columns: minmax(0, 1fr); }
  .news-grid--all .ncard--feature .ncard__media { min-height: 0; aspect-ratio: 21 / 9; border-radius: 9px 9px 0 0; }
  .news-grid--all .ncard--feature .ncard__body { padding: 24px 26px 28px; }
  .news-grid--all .ncard--feature .ncard__media .badge { left: 26px; top: 20px; } /* on the text's left edge */
  .news-grid--related .ncard:nth-child(3) { display: none; }
  .article { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .article__aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .legal__toc { position: static; }
  .legal__toc-box { gap: 0; border: 1px solid var(--line); border-radius: var(--r-4); background: #0b0d10; }
  .legal__toc-box > summary { pointer-events: auto; cursor: pointer; padding: 14px 16px; }
  .legal__toc-box > summary .icon { display: block; }
  .legal__toc-box[open] > ol { padding: 0 8px 10px; }
  .legal__toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
}
@media (max-width: 680px) {
  .news-grid--all, .news-grid--related { grid-template-columns: minmax(0, 1fr); }
  .news-grid--all .ncard--feature .ncard__media { aspect-ratio: 16 / 9; }
  .news-grid--related .ncard:nth-child(3) { display: flex; }
  .is-article .news-hero { min-height: 0; padding-top: calc(var(--header-h) + 120px); }
  .article__aside { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 19px; }
  .news-nav { grid-template-columns: minmax(0, 1fr); margin-top: 44px; }
  .news-nav__link--next { text-align: left; justify-items: start; }
  .news-nav__link--next .news-nav__dir { flex-direction: row; }
  .legal-tabs { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .legal-tabs .tab { gap: 7px; padding: 0 11px; font-size: 14px; }
  .legal-tabs .tab .icon { display: none; }
  .tab__full { display: none; }
  .tab__short { display: inline; }
  .legal__actions [data-print] { display: none; }
  .legal__toc ol { grid-template-columns: minmax(0, 1fr); }
  .legal__sec + .legal__sec { margin-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .nosignal__code { animation: none; }
}

/* ================= PRINT (documents, articles) ================= */
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #000 !important; }
  .site-header, .site-footer, .page-hero .scene, .legal-tabs, .legal__toc, .legal__actions, .article__aside, .news-nav, .news-related, .skip-link { display: none !important; }
  .page-hero { padding: 0 0 12px !important; min-height: 0 !important; }
  .page-hero *, .prose, .prose *, .legal__doc-title, .legal__updated { color: #000 !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
  .section { padding: 0 !important; }
  .legal { display: block; }
  .legal__sec { break-inside: avoid-page; }
  .prose a { text-decoration: underline; }
}
.legal-page { padding-top: 0; }
@media (max-width: 680px) { .nosignal .cam__meta { display: none; } }
