/* Шрифты IBM Plex (self-hosted, только кириллица и латиница) */
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-mono-400-cyrillic.woff2) format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-mono-400-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-mono-500-cyrillic.woff2) format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-mono-500-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400 600;font-display:swap;src:url(../fonts/ibm-plex-sans-cyrillic.woff2) format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400 600;font-display:swap;src:url(../fonts/ibm-plex-sans-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans Condensed";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-sans-condensed-500-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans Condensed";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/ibm-plex-sans-condensed-600-latin.woff2) format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/* Jamper — IT-блог.
   Строгая 12-колоночная сетка, одно семейство IBM Plex, чёрный текст на белом
   и один красный акцент для служебных отметок (прогресс, активный пункт, ссылки при наведении). */

:root {
  --bg: #ffffff;
  --fg: #151515;
  --muted: #64666b;
  --rule: #e2e2df;
  --soft: #f4f4f1;
  --accent: #cf1f1f;
  --link-line: #cf1f1f66;
  --code-key: #8a1c1c;
  --code-val: #1d4e89;
  --code-sel: #151515;
  --code-com: #8a8c90;
  --hero-ink: #f4f4f1;
  --hero-dim: #c9cacc;
  --hero-shade: #0d0d0d;

  --f-head: "IBM Plex Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-text: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --t-xs: .8125rem;
  --t-s: .9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.25rem;
  --t-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --t-2xl: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --t-3xl: clamp(2.2rem, 1.5rem + 3vw, 3.6rem);

  --wrap: 1280px;
  --gutter: clamp(16px, 3.5vw, 40px);
  --col-gap: clamp(16px, 2vw, 32px);
  --head-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --fg: #ebebe8; --muted: #9b9da1; --rule: #2a2a29; --soft: #1b1b1a;
    --accent: #ff5a4f; --link-line: #ff5a4f80;
    --code-key: #ff9c8f; --code-val: #9cc4ff; --code-sel: #ebebe8; --code-com: #7c7e82;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --fg: #ebebe8; --muted: #9b9da1; --rule: #2a2a29; --soft: #1b1b1a;
  --accent: #ff5a4f; --link-line: #ff5a4f80;
  --code-key: #ff9c8f; --code-val: #9cc4ff; --code-sel: #ebebe8; --code-com: #7c7e82;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 24px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--t-m)/1.6 var(--f-text); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-family: var(--f-head); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
time, .num { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.skip { position: absolute; left: -9999px; z-index: 100; background: var(--fg); color: var(--bg); padding: .5rem 1rem; }
.skip:focus { left: 8px; top: 8px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font: 500 var(--t-xs)/1.3 var(--f-text); color: var(--muted); }
.label a { text-decoration: none; }
.label a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  transition: transform .3s ease;
}
.site-header.up { transform: translateY(-100%); }
.site-header .wrap { display: flex; align-items: center; gap: 2rem; height: var(--head-h); }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; white-space: nowrap; color: var(--fg); }
.logo-mark { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo-mark circle { fill: currentColor; }
.logo-mark .jmp { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-dasharray: 40; stroke-dashoffset: 0; }
.logo-mark .hd { fill: var(--accent); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.logo:hover .jmp { animation: jmp .6s cubic-bezier(.2, .7, .2, 1); }
.logo:hover .hd { transform: translateX(2px); }
@keyframes jmp { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
.logo-word { font: 500 1.375rem/1 var(--f-mono); letter-spacing: -.03em; }
.logo-tld { font: 400 .8rem/1 var(--f-mono); color: var(--muted); margin-left: -.45rem; align-self: flex-end; padding-bottom: .2rem; }
.nav { display: flex; gap: 1.5rem; font-size: var(--t-s); }
.nav a { text-decoration: none; color: var(--muted); padding-block: .4rem; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current] { color: var(--fg); border-bottom-color: var(--fg); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; font-size: var(--t-s); }
.tbtn { background: none; border: 0; padding: .4rem 0; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: .5rem; }
.tbtn:hover { color: var(--fg); }
.tbtn kbd { font: 400 .75rem/1 var(--f-mono); border: 1px solid var(--rule); padding: .2rem .35rem; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .site-header .wrap { gap: 1rem; }
  .menu-btn { display: inline-flex; }
  .tbtn kbd { display: none; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--rule); padding: .5rem var(--gutter) 1rem; }
  .nav:not(.open) { display: none; }
  .nav a { padding-block: .7rem; font-size: var(--t-m); border-bottom: 1px solid var(--rule); }
}

/* ---------- появление ---------- */
.rise { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@supports (animation-timeline: view()) {
  .in-view { animation: inview linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  @keyframes inview { from { opacity: .15; transform: translateY(18px); } }
}

/* ---------- главная ---------- */
.intro { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem); border-bottom: 1px solid var(--fg); }
.intro h1 { grid-column: 1 / span 8; font-size: var(--t-3xl); line-height: 1.05; font-weight: 600; }
.intro h1 em { font-style: normal; color: var(--muted); }
.facts { grid-column: 10 / span 3; align-self: end; display: grid; gap: .9rem; margin: 0; font-size: var(--t-s); }
.facts div { display: grid; gap: .1rem; border-top: 1px solid var(--rule); padding-top: .6rem; }
.facts dt { color: var(--muted); font-size: var(--t-xs); }
.facts dd { margin: 0; }
.facts a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.facts a:hover { border-color: var(--fg); }

.lead { padding-block: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.lead .pic { grid-column: 1 / span 7; overflow: hidden; background: var(--soft); }
.lead .pic img { width: 100%; aspect-ratio: 1024 / 538; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.lead:hover .pic img { transform: scale(1.025); }
.lead .txt { grid-column: 8 / span 5; display: grid; gap: 1rem; align-content: center; }
.lead h2 { font-size: var(--t-2xl); line-height: 1.08; }
.lead h2 a { text-decoration: none; }
.lead h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.lead .txt > p:not(.label) { color: var(--muted); font-size: var(--t-l); line-height: 1.5; }
.more { font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--fg); justify-self: start; padding-bottom: .1rem; }
.more:hover { color: var(--accent); border-color: var(--accent); }

.archive { padding-block: clamp(1rem, 3vw, 2rem) clamp(2.5rem, 5vw, 4rem); }
.archive-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; margin-bottom: 2rem; }
.archive-head h2 { font-size: var(--t-xl); }
.filter { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: var(--t-s); }
.filter button { background: none; border: 0; padding: .25rem 0; cursor: pointer; color: var(--muted); border-bottom: 1px solid transparent; }
.filter button:hover { color: var(--fg); }
.filter button[aria-pressed="true"] { color: var(--fg); border-bottom-color: var(--accent); }

.year { border-top: 1px solid var(--fg); padding-top: 1rem; }
.year + .year { margin-top: 3rem; }
.year[hidden] { display: none; }
.year-title { grid-column: 1 / span 2; position: sticky; top: calc(var(--head-h) + 1rem); align-self: start; font-size: var(--t-2xl); line-height: 1; font-weight: 500; color: var(--muted); }
.year > ol { grid-column: 3 / span 10; }
.entry { position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 9rem 8.5rem; gap: var(--col-gap); padding-block: 1.1rem; border-bottom: 1px solid var(--rule); align-items: start; }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }
.entry time { font: 400 var(--t-s)/1.5 var(--f-mono); color: var(--muted); padding-top: .15rem; }
.entry-title { margin: 0 0 .35rem; font: 600 var(--t-l)/1.3 var(--f-text); letter-spacing: -.005em; }
.entry-title a { text-decoration: none; }
.entry-title a::after { content: ""; position: absolute; inset: 0; }
.entry:hover .entry-title a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.entry p { color: var(--muted); font-size: var(--t-s); line-height: 1.55; }
.entry .cat { font-size: var(--t-s); color: var(--muted); padding-top: .2rem; position: relative; z-index: 1; display: grid; gap: .1rem; align-content: start; }
.entry .cat a { text-decoration: none; }
.entry .cat a:hover { color: var(--fg); text-decoration: underline; }
.entry .th { overflow: hidden; background: var(--soft); aspect-ratio: 3 / 2; }
/* обложки на сайте разнородные: в списке приводим их к одному тону, цвет — при наведении */
.entry .th img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); opacity: .9; transition: filter .4s ease, opacity .4s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.entry:hover .th img { filter: none; opacity: 1; transform: scale(1.04); }

.pager { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--fg); font-size: var(--t-s); }
.pager span { color: var(--muted); }

.rubrics { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--rule); }
.rubrics h2 { grid-column: 1 / span 2; font-size: var(--t-xl); }
.rubrics ul { grid-column: 3 / span 10; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1.5rem var(--col-gap); }
.rubrics li a { display: grid; gap: .35rem; text-decoration: none; }
.rubrics li b { font: 600 var(--t-l)/1.2 var(--f-head); }
.rubrics li a:hover b { text-decoration: underline; text-decoration-color: var(--accent); }
.rubrics li span { color: var(--muted); font-size: var(--t-s); line-height: 1.5; }

@media (max-width: 1000px) {
  .intro h1 { grid-column: 1 / -1; }
  .facts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); margin-top: 2rem; }
  .lead .pic, .lead .txt { grid-column: 1 / -1; }
  .lead .txt { margin-top: 1.25rem; }
  .year-title { grid-column: 1 / -1; position: static; margin-bottom: 1rem; font-size: var(--t-xl); }
  .year > ol { grid-column: 1 / -1; }
  .entry { grid-template-columns: 4.5rem minmax(0, 1fr) 7rem; }
  .entry .cat { display: none; }
  .rubrics h2, .rubrics ul { grid-column: 1 / -1; }
  .rubrics h2 { margin-bottom: 1.25rem; }
}
@media (max-width: 600px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .entry { grid-template-columns: minmax(0, 1fr) 5.5rem; row-gap: .3rem; }
  .entry time { grid-column: 1 / -1; padding: 0; }
  .entry p { display: none; }
}

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--fg); padding-block: 2.5rem 2rem; margin-top: 2rem; font-size: var(--t-s); }
.site-footer .about { grid-column: 1 / span 6; display: grid; gap: .75rem; align-content: start; }
.site-footer .about p { color: var(--muted); max-width: 40ch; }
.site-footer nav { grid-column: span 3; }
.site-footer h2 { font: 500 var(--t-xs)/1 var(--f-text); color: var(--muted); margin-bottom: .9rem; }
.site-footer nav ul { display: grid; gap: .45rem; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .copy { grid-column: 1 / -1; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; color: var(--muted); font-size: var(--t-xs); }
@media (max-width: 800px) {
  .site-footer .about { grid-column: 1 / -1; margin-bottom: 2rem; }
  .site-footer nav { grid-column: span 6; }
}

/* ---------- поиск ---------- */
.search { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--bg) 70%, transparent); display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; }
.search-box { width: min(640px, 100%); background: var(--bg); border: 1px solid var(--fg); animation: rise .25s ease both; }
.search-box label { display: flex; gap: .75rem; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid var(--rule); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: 400 var(--t-l)/1.3 var(--f-text); }
.search-box ul { max-height: 50vh; overflow: auto; }
.search-box li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .8rem 1.1rem; text-decoration: none; border-bottom: 1px solid var(--rule); }
.search-box li a span:last-child { color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }
.search-box li a:hover, .search-box li a:focus { background: var(--soft); outline: 0; }
.search-box .empty { padding: 1rem 1.1rem; color: var(--muted); }

/* ================= СТАТЬЯ ================= */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .progress i { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.a-head { position: relative; isolation: isolate; overflow: hidden; color: var(--hero-ink); background: var(--hero-shade); padding-block: 1.5rem clamp(2.5rem, 6vw, 5rem); min-height: clamp(420px, 62vh, 640px); display: flex; align-items: stretch; }
.a-head > .wrap { width: 100%; grid-template-rows: auto 1fr; }
/* обложка растянута на весь блок; размытие прячет низкое разрешение, градиент даёт контраст для заголовка */
.a-bg { position: absolute; inset: -40px; z-index: -2; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; filter: blur(14px) saturate(1.1); transform: scale(1.04); animation: bg-in 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.a-head::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, color-mix(in srgb, var(--hero-shade) 94%, transparent) 0%, color-mix(in srgb, var(--hero-shade) 72%, transparent) 50%, color-mix(in srgb, var(--hero-shade) 58%, transparent) 100%),
    linear-gradient(to right, color-mix(in srgb, var(--hero-shade) 55%, transparent), transparent 70%); }
@keyframes bg-in { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1.04); } }
.a-head .label, .a-head .crumbs a { color: var(--hero-dim); }
.a-head .crumbs a:hover, .a-head .meta a:hover { color: var(--hero-ink); }
.crumbs { grid-column: 1 / -1; margin-bottom: clamp(3rem, 9vw, 7rem); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; }
.crumbs li + li::before { content: "/"; margin-right: .35rem; opacity: .5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.a-head .meta { grid-column: 4 / span 7; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-self: end; align-content: end; }
.a-head .meta a { color: var(--hero-ink); border-bottom: 2px solid var(--accent); text-decoration: none; }
.a-head h1 { grid-column: 4 / span 8; font-size: var(--t-3xl); line-height: 1.05; margin-block: 1rem 1.25rem; color: var(--hero-ink); text-shadow: 0 1px 24px color-mix(in srgb, var(--hero-shade) 50%, transparent); }
.a-head h1 code { font: inherit; }
.a-head .lede { grid-column: 4 / span 6; font-size: var(--t-l); line-height: 1.55; color: var(--hero-dim); }
.a-head .by { grid-column: 4 / span 7; margin-top: 1.5rem; font-size: var(--t-s); }
.a-head .by a { font-weight: 500; text-decoration: none; color: var(--hero-ink); border-bottom: 1px solid color-mix(in srgb, var(--hero-ink) 40%, transparent); }

.a-body { padding-block: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.toc { grid-column: 1 / span 3; position: sticky; top: calc(var(--head-h) + 2rem); font-size: var(--t-s); padding-right: 1rem; }
.toc h2 { font: 500 var(--t-xs)/1 var(--f-text); color: var(--muted); margin-bottom: .9rem; }
.toc-track { position: relative; }
.toc ol { border-left: 1px solid var(--rule); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc ol a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); padding: .35rem 0 .35rem .9rem; text-decoration: none; color: var(--muted); line-height: 1.4; transition: color .2s; }
.toc ol a::before { content: counter(toc) "."; font: 400 var(--t-xs)/1.75 var(--f-mono); }
.toc a:hover, .toc a.on { color: var(--fg); }
.toc .marker { position: absolute; left: -1px; top: 0; width: 2px; height: 0; background: var(--accent); transition: transform .35s cubic-bezier(.2, .7, .2, 1), height .35s cubic-bezier(.2, .7, .2, 1); }
.toc .share { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--rule); display: grid; gap: .4rem; justify-items: start; }
.toc .share a, .toc .share button { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; color: var(--muted); }
.toc .share a:hover, .toc .share button:hover { color: var(--fg); text-decoration: underline; }

.prose { grid-column: 4 / span 6; min-width: 0; font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem); line-height: 1.72; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: var(--t-xl); line-height: 1.2; margin-top: 2.2em; }
.prose h2 + * { margin-top: .8em; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: var(--link-line); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose :not(pre) > code { font: 400 .88em/1 var(--f-mono); background: var(--soft); padding: .15em .35em; white-space: nowrap; }

/* заметки на полях: справа на широком экране, в потоке — на узком */
.note { float: right; clear: right; width: 15rem; margin: .25em calc(-15rem - var(--col-gap) * 2) 1em 0; font-size: var(--t-s); line-height: 1.5; color: var(--muted); border-top: 1px solid var(--rule); padding-top: .5rem; }
.note b { color: var(--fg); font-weight: 500; }

.summary { border-top: 2px solid var(--fg); border-bottom: 1px solid var(--rule); padding-block: 1rem 1.1rem; font-size: var(--t-m); line-height: 1.55; }
.summary h2 { font: 500 var(--t-xs)/1 var(--f-text); color: var(--muted); margin: 0 0 .75rem; letter-spacing: 0; }
.summary ul { display: grid; gap: .4rem; }

.code { margin-inline: 0; background: var(--soft); border-left: 2px solid var(--fg); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: .5rem 1rem; border-bottom: 1px solid var(--rule); font: 400 var(--t-xs)/1 var(--f-mono); color: var(--muted); }
.copy-btn { background: none; border: 0; padding: .2rem 0; cursor: pointer; font: inherit; color: var(--muted); }
.copy-btn:hover { color: var(--fg); text-decoration: underline; }
.copy-btn.ok { color: var(--fg); }
.code pre { margin: 0; padding: 1rem; overflow-x: auto; font: 400 .9rem/1.65 var(--f-mono); tab-size: 2; }
.code code { font-family: var(--f-mono); }
.tk-sel { color: var(--code-sel); font-weight: 500; }
.tk-prop { color: var(--code-key); }
.tk-val { color: var(--code-val); }
.tk-com { color: var(--code-com); }

.demo { margin-top: .6rem !important; border: 1px solid var(--rule); }
.demo-bar { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .8rem; border-bottom: 1px solid var(--rule); font: 400 var(--t-xs)/1.2 var(--f-mono); color: var(--muted); }
.demo-stage { height: 140px; background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 20px 20px; background-position: center; }
.demo-stage .parent { height: 100%; }
.demo-stage .child { display: inline-block; padding: .5rem .75rem; background: var(--fg); color: var(--bg); font: 500 .8rem/1 var(--f-mono); }

.tbl { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-s); line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: .65rem .75rem .65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 500; color: var(--muted); font-size: var(--t-xs); border-bottom-color: var(--fg); }
.prose td.n { color: var(--muted); }

.a-end { margin-top: 3rem !important; padding-top: 1.5rem; border-top: 1px solid var(--fg); display: grid; gap: 2rem; font-size: var(--t-s); }
.a-end .author { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; }
.ava { width: 48px; height: 48px; display: grid; place-items: center; background: var(--fg); color: var(--bg); font: 600 1.1rem/1 var(--f-head); }
.a-end .author b { font-weight: 600; }
.a-end .author p { color: var(--muted); margin-top: .2rem; line-height: 1.55; }
.prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); }
.prevnext a { display: grid; gap: .3rem; align-content: start; text-decoration: none; padding-top: .75rem; border-top: 1px solid var(--rule); transition: border-color .2s; }
.prevnext a:hover { border-color: var(--accent); }
.prevnext a:last-child { text-align: right; }
.prevnext span { color: var(--muted); font-size: var(--t-xs); }
.prevnext b { font-weight: 500; line-height: 1.4; }

.related { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--fg); }
.related h2 { grid-column: 1 / span 3; font-size: var(--t-xl); }
.related ul { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
.rel { position: relative; display: grid; gap: .6rem; align-content: start; }
.rel .th { overflow: hidden; aspect-ratio: 3 / 2; background: var(--soft); }
.rel .th img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .4s, transform .6s cubic-bezier(.2, .7, .2, 1); }
.rel:hover .th img { filter: none; transform: scale(1.04); }
.rel h3 { font: 600 var(--t-m)/1.35 var(--f-text); }
.rel h3 a { text-decoration: none; }
.rel h3 a::after { content: ""; position: absolute; inset: 0; }
.rel:hover h3 a { text-decoration: underline; text-decoration-color: var(--accent); }

.comments { padding-block: clamp(2rem, 4vw, 3rem) 1rem; border-top: 1px solid var(--rule); }
.comments h2 { grid-column: 1 / span 3; font-size: var(--t-xl); }
.comments .body { grid-column: 4 / span 6; }
.comments .body > p { color: var(--muted); margin-bottom: 1.5rem; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem var(--col-gap); }
.field { display: grid; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: var(--t-xs); color: var(--muted); }
.field input, .field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--muted); background: transparent; color: var(--fg); padding: .5rem 0; font: 400 var(--t-m)/1.5 var(--f-text); border-radius: 0; transition: border-color .2s; }
.field textarea { min-height: 120px; resize: vertical; border: 1px solid var(--rule); padding: .7rem; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--fg); }
.check { grid-column: 1 / -1; display: flex; gap: .6rem; align-items: start; font-size: var(--t-s); color: var(--muted); }
.check input { margin-top: .3rem; accent-color: var(--fg); }
.submit { justify-self: start; background: var(--fg); color: var(--bg); border: 0; padding: .8rem 1.5rem; font-weight: 500; cursor: pointer; transition: background .2s; }
.submit:hover { background: var(--accent); }
.form-note { grid-column: 1 / -1; font-size: var(--t-s); }

details.toc-m { display: none; }
@media (max-width: 1240px) {
  .note { float: none; width: auto; margin: 1em 0; }
}
@media (max-width: 1000px) {
  .a-head .meta, .a-head h1, .a-head .lede, .a-head .by, .prose { grid-column: 1 / -1; }
  .prose { max-width: 42rem; }
  .toc { display: none; }
  details.toc-m { display: block; border-block: 1px solid var(--rule); padding-block: .75rem; font-size: var(--t-s); }
  details.toc-m summary { cursor: pointer; font-weight: 500; }
  details.toc-m ol { list-style: decimal; padding-left: 1.4rem; margin-top: .6rem; display: grid; gap: .35rem; }
  .related h2, .related ul, .comments h2, .comments .body { grid-column: 1 / -1; }
  .related h2, .comments h2 { margin-bottom: 1.25rem; }
}
@media (max-width: 640px) {
  .related ul, .prevnext, .form { grid-template-columns: minmax(0, 1fr); }
  .prevnext a:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= WordPress ================= */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
span.logo { cursor: default; }

/* шапка архивов, поиска, страниц */
.intro-s { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1.75rem, 3.5vw, 3rem); }
.intro-s .crumbs { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.intro-s h1 { font-size: var(--t-2xl); line-height: 1.08; }
.intro-desc { grid-column: 1 / span 7; margin-top: 1rem; color: var(--muted); font-size: var(--t-l); line-height: 1.5; }
.intro .sform { grid-column: 1 / span 7; margin-top: 1.5rem; }
.archive-head-s:empty { display: none; }
.empty-note { color: var(--muted); }
.crumbs li[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

.sform { display: flex; gap: 1rem; align-items: end; }
.sform input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--muted); background: transparent; color: var(--fg); padding: .5rem 0; font: 400 var(--t-m)/1.5 var(--f-text); border-radius: 0; }
.sform input:focus { outline: 0; border-color: var(--fg); }

.pager > i { flex: 0 0 auto; }

/* статья без обложки */
.a-head.no-pic { min-height: clamp(340px, 46vh, 520px); }

/* оглавление: подразделы */
.toc li.lvl-3 { counter-increment: none; }
.toc li.lvl-3 a { padding-left: 1.9rem; grid-template-columns: minmax(0, 1fr); font-size: var(--t-xs); }
.toc li.lvl-3 a::before { content: none; }

/* текст статьи: элементы из редактора */
.prose h3 { font-size: var(--t-l); line-height: 1.3; margin-top: 1.8em; }
.prose h4 { font: 600 var(--t-m)/1.4 var(--f-text); margin-top: 1.6em; }
.prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose h2 strong, .prose h3 strong, .prose h4 strong { font-weight: inherit; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose li > ul, .prose li > ol { margin-top: .35em; }
.prose ul.toc-m, .prose details ol { padding-left: 1.4rem; }
.prose blockquote { margin-inline: 0; padding: .25em 0 .25em 1.25em; border-left: 2px solid var(--accent); color: var(--muted); }
.prose blockquote p + p { margin-top: .8em; }
.prose blockquote cite { display: block; margin-top: .5em; font-size: var(--t-s); font-style: normal; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.prose figure { margin-inline: 0; }
.prose img { height: auto; }
.prose figcaption, .prose .wp-element-caption { margin-top: .5rem; font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.prose .wp-block-image.aligncenter, .prose .aligncenter { margin-inline: auto; text-align: center; }
.prose .aligncenter img { margin-inline: auto; }
.prose .alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.prose .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: .75rem; }
.prose .wp-block-gallery figure { margin: 0; }
.prose .wp-block-gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.prose .wp-block-embed iframe, .prose iframe { max-width: 100%; }
.prose .wp-block-embed__wrapper { position: relative; }
.prose .wp-block-preformatted, .prose pre:not(.code pre) { font: 400 .9rem/1.65 var(--f-mono); background: var(--soft); padding: 1rem; overflow-x: auto; white-space: pre; }
.prose .code code, .prose pre code { white-space: pre; }
.prose figure.tbl { overflow-x: auto; }
.prose mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; padding: 0 .15em; }
.prose kbd { font: 400 .85em/1 var(--f-mono); border: 1px solid var(--rule); padding: .15em .35em; }
.prose .post-views { display: none; } /* счётчик просмотров плагина в тексте не нужен */
.prose .page-links { margin-top: 2rem; }

/* подсветка синтаксиса (assets/js/main.js) */
.tk-kw { color: var(--code-key); font-weight: 500; }
.tk-str { color: var(--code-val); }
.tk-var { color: var(--code-key); }
.tk-num { color: var(--code-val); }
.tk-fn { color: var(--code-sel); font-weight: 500; }
.tk-tag { color: var(--code-key); }
.tk-attr { color: var(--code-val); }

/* блок похожих записей плагина SPAI внутри статьи */
.prose .spai_widget, .prose [class^="spai"] { margin-top: 2.5rem; font-size: var(--t-s); }

/* комментарии */
.comments h2 .num { color: var(--muted); font-weight: 500; }
.comment-list { display: grid; gap: 1.5rem; margin-bottom: 2.5rem; }
.comment-list .children { margin: 1.5rem 0 0 2rem; padding-left: 1.25rem; border-left: 1px solid var(--rule); display: grid; gap: 1.5rem; }
.cmt { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 1rem; }
.cmt .ava { width: 40px; height: 40px; font-size: .95rem; }
.cmt-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; margin-bottom: .35rem; }
.cmt-author { color: var(--fg); font-weight: 600; font-size: var(--t-s); }
.cmt-text { font-size: var(--t-m); line-height: 1.6; overflow-wrap: anywhere; }
.cmt-text p + p { margin-top: .7em; }
.cmt-text code { font: 400 .88em/1 var(--f-mono); background: var(--soft); padding: .1em .3em; }
.cmt-wait { color: var(--accent); font-size: var(--t-s); }
.cmt-reply { margin-top: .4rem; font-size: var(--t-s); }
.cmt-reply a { color: var(--muted); }
.cmt-reply a:hover { color: var(--fg); }
.comment-respond { margin-top: 1rem; }
.comment-reply-title { font: 500 var(--t-xs)/1 var(--f-text); color: var(--muted); margin-bottom: 1.25rem; letter-spacing: 0; }
.comment-reply-title small { margin-left: 1rem; }
.comment-reply-title small a { color: var(--fg); }
.comment-list .comment-respond { margin-block: 1.5rem 0; }
.comments-pagination, .comment-navigation { display: flex; justify-content: space-between; margin-bottom: 2rem; font-size: var(--t-s); }
.form .form-submit { margin: 0; grid-column: 1 / -1; }

@media (max-width: 1000px) {
  .intro-desc, .intro .sform { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .comment-list .children { margin-left: .5rem; padding-left: .75rem; }
  .prose .alignleft, .prose .alignright { float: none; margin: 1em 0; max-width: 100%; }
}
@media print {
  .site-header, .site-footer, .toc, .related, .comments, .progress, .share, .search, .copy-btn { display: none !important; }
  .a-head { color: #000; background: none; min-height: 0; }
  .a-head h1, .a-head .lede { color: #000; text-shadow: none; }
  .a-bg, .a-head::after { display: none; }
  .prose { grid-column: 1 / -1; }
}
.intro-s .facts { grid-row: 2 / span 2; }
@media (max-width: 1000px) { .intro-s .facts { grid-row: auto; order: 3; } .intro-s .intro-desc { order: 2; } }

/* ================= Автор ================= */
.ava-img { object-fit: cover; border-radius: 0; }
.a-end .author .ava-img { width: 48px; height: 48px; }
.a-end .author b a { text-decoration: none; }
.a-end .author b a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.author-role { display: block; color: var(--muted); font-size: var(--t-xs); margin-top: .1rem; }
.a-end .author .more { display: inline-block; margin-top: .6rem; font-size: var(--t-s); }

.author-id { grid-column: 1 / span 8; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); align-items: center; }
.ava-xl { width: clamp(72px, 9vw, 112px); height: clamp(72px, 9vw, 112px); display: grid; place-items: center; background: var(--fg); color: var(--bg); font: 600 clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem)/1 var(--f-head); }
.author-head h1 { font-size: var(--t-3xl); line-height: 1.02; }
.author-job { margin-top: .6rem; color: var(--muted); font-size: var(--t-l); }
.author-job a { color: var(--fg); text-decoration-color: var(--link-line); }

.author-body { padding-block: clamp(1rem, 3vw, 2rem) 0; }
.author-sec { padding-block: clamp(1.75rem, 3.5vw, 2.75rem); border-bottom: 1px solid var(--rule); align-items: start; }
.author-sec > h2 { grid-column: 1 / span 3; font-size: var(--t-xl); line-height: 1.15; }
.author-sec > .prose, .author-sec > .author-col { grid-column: 4 / span 7; }
.author-sec .prose h3 { font-size: var(--t-l); }
.author-col h3.label { font-family: var(--f-text); font-size: var(--t-xs); margin: 1.75rem 0 .75rem; }
.author-col > h3.label:first-child { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { font: 400 var(--t-xs)/1 var(--f-mono); border: 1px solid var(--rule); padding: .45rem .6rem; }
.author-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .5rem var(--col-gap); }
.author-cats li { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding-top: .5rem; font-size: var(--t-s); }
.author-cats a { text-decoration: none; font-weight: 500; }
.author-cats a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.author-cats .num { color: var(--muted); font: 400 var(--t-xs)/1.6 var(--f-mono); white-space: nowrap; }
.author-langs { font-size: var(--t-s); }

.author-list { display: grid; gap: .9rem; }
.author-list li { display: grid; gap: .2rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
.author-list li:first-child { border-top: 0; padding-top: 0; }
.author-list b { font-weight: 600; }
.author-list b a { text-decoration-color: var(--link-line); }
.author-list b a:hover { text-decoration-color: var(--accent); }
.author-list span { color: var(--muted); font-size: var(--t-s); line-height: 1.5; }

.principles { counter-reset: pr; display: grid; gap: .75rem; }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 2rem minmax(0, 1fr); line-height: 1.55; }
.principles li::before { content: counter(pr, decimal-leading-zero); font: 400 var(--t-xs)/1.9 var(--f-mono); color: var(--accent); }
.author-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.author-links a { font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--fg); }
.author-links a:hover { color: var(--accent); border-color: var(--accent); }
.author-head + .author-body + .archive, .author-head + .archive { padding-top: clamp(2rem, 4vw, 3rem); }

@media (max-width: 1000px) {
  .author-id { grid-column: 1 / -1; }
  .author-sec > h2, .author-sec > .prose, .author-sec > .author-col { grid-column: 1 / -1; }
  .author-sec > h2 { margin-bottom: 1rem; }
}

/* Рекламные блоки AdSense (inc/tracking.php) */
.ad { display: grid; gap: .4rem; margin-block: 2rem; min-height: 120px; }
.ad .label { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.ad ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.site-footer > .ad { max-width: var(--wrap); margin: 2rem auto 0; padding: 1.5rem var(--gutter) 0; }
