/*
Theme Name: Нотатки лінгвомана · Термінал
Theme URI: https://anvarazizov.me
Author: Анвар Азізов
Description: Темна тема з термінальними деталями для блогу «Нотатки лінгвомана».
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: nl-terminal
*/


/* 1 · ТОКЕНИ ------------------------------------------------------- */
:root, .site {
  /* нейтральні */
  --bg: #0E0F10;
  --bg-raised: #141617;
  --bg-sunken: #1A1C1F;
  --line: #25282C;
  --line-strong: #363B41;
  --line-hover: #4A5057;
  --text: #E7E6E2;
  --text-2: #A9ADB1;
  --text-3: #83878C;
  --grid: rgba(255, 255, 255, .035);

  /* акцент: бурштин P3 · варіанти: фосфор P1 #5FE3A1, ціан #6CCFF6 */
  --accent: #F5B544;
  --on-accent: #0E0F10;
  --danger: #FF8E7E;
  --ok: #5FE3A1;

  /* підсвітка коду */
  --syn-comment: #83878C;
  --syn-keyword: #C9A7F5;
  --syn-string: #A9D8A2;
  --syn-number: #F2C27F;
  --syn-func: #8FC6F5;
  --syn-punct: #A9ADB1;

  /* шрифти */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* шкала (десктоп) */
  --fs-display: 52px; --lh-display: 60px;
  --fs-h1: 44px;      --lh-h1: 52px;
  --fs-h2: 28px;      --lh-h2: 36px;
  --fs-h3: 22px;      --lh-h3: 30px;
  --fs-h4: 18px;      --lh-h4: 28px;
  --fs-lead: 20px;    --lh-lead: 32px;
  --fs-entry: 22px;   --lh-entry: 30px;
  --fs-body: 18px;    --lh-body: 30px;
  --fs-small: 16px;   --lh-small: 26px;
  --fs-meta: 13px;    --lh-meta: 20px;
  --fs-code: 14px;    --lh-code: 24px;

  /* відступи */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* радіуси */
  --r-s: 4px; --r-m: 8px; --r-l: 12px;

  /* макет */
  --container: 1120px;
  --gutter: 40px;
  --measure: 680px;
  --sidebar: 280px;
  --header-h: 64px;

  /* рух */
  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* похідні від акценту — перераховуються там, де акцент перевизначено */
:root, .site, .accent-scope {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-select: color-mix(in srgb, var(--accent) 32%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --accent-hover: color-mix(in srgb, var(--accent), #fff 16%);
  --accent-press: color-mix(in srgb, var(--accent), #000 14%);
}

/* мобільна шкала (≤ 720) */
@media (max-width: 720px) {
  :root, .site {
    --fs-display: 34px; --lh-display: 40px;
    --fs-h1: 30px;      --lh-h1: 38px;
    --fs-h2: 24px;      --lh-h2: 32px;
    --fs-h3: 20px;      --lh-h3: 28px;
    --fs-h4: 17px;      --lh-h4: 26px;
    --fs-lead: 17px;    --lh-lead: 28px;
    --fs-entry: 19px;   --lh-entry: 27px;
    --fs-body: 17px;    --lh-body: 28px;
    --fs-small: 15px;   --lh-small: 24px;
    --fs-code: 13px;    --lh-code: 22px;
    --gutter: 20px;
    --header-h: 56px;
  }
}

/* 2 · БАЗА --------------------------------------------------------- */
.site {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.site *, .site *::before, .site *::after { box-sizing: border-box; }
.site ::selection { background: var(--accent-select); color: var(--text); }
.site a { color: inherit; }
.site :where(button, input, textarea, select) { font: inherit; color: inherit; }
.site img, .site svg { display: block; max-width: 100%; }
.site :focus { outline: none; }
.site :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page { display: flex; flex-direction: column; min-height: 100vh; font-size: var(--fs-body); line-height: var(--lh-body); }
.page > main { flex: 1 0 auto; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 860px; }

.mono { font-family: var(--font-mono); }
.t-2 { color: var(--text-2); }
.t-3 { color: var(--text-3); }
.t-accent { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 50; padding: 10px 14px; border-radius: var(--r-m); background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: 14px; text-decoration: none; }
.skip-link:focus-visible { top: 12px; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 16px; height: 16px; }
.only-mobile { display: none !important; }
@media (max-width: 720px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }
}

/* 3 · ШАПКА -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }

.prompt { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; color: var(--text); text-decoration: none; border-radius: var(--r-s); }
.prompt__user { color: var(--accent); }
.prompt__at, .prompt__colon, .prompt__sign { color: var(--text-3); }
.prompt__path { color: var(--text-2); }
.prompt:hover .prompt__host { color: var(--accent); }
.cursor { display: inline-block; width: .55em; height: 1.1em; margin-left: .45em; background: var(--accent); vertical-align: -.18em; animation: blink 1.1s steps(1, end) infinite; }
.prompt .cursor { display: block; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-m); background: none;
  font-family: var(--font-mono); font-size: 14px; color: var(--text-2); text-decoration: none; cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.nav__link:hover { color: var(--text); background-color: var(--bg-raised); }
.nav__link:active { background-color: var(--line); }
.nav__link[aria-current="page"], .nav__link[aria-expanded="true"] { color: var(--text); }
.nav__link[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--accent); }
.nav__link[aria-expanded="true"] { background-color: var(--bg-raised); }
.nav__link[aria-expanded="true"] .ico { transform: rotate(180deg); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: none;
  font-family: var(--font-mono); font-size: 13px; color: var(--text); text-decoration: none; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--bg-raised); }
.icon-btn:active { background: var(--line); }
.menu-btn { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .prompt { font-size: 14px; }
}

/* випадне меню категорій */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 300px; padding: 6px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-l); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.dropdown__label { margin: 0; padding: 8px 12px 6px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.dropdown a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 0 12px; border-radius: var(--r-m); font-family: var(--font-mono); font-size: 14px; color: var(--text-2); text-decoration: none; text-transform: lowercase; }
.dropdown a::after { content: "→"; color: var(--text-3); opacity: 0; }
.dropdown a:hover { background: var(--bg-sunken); color: var(--text); }
.dropdown a:hover::after { opacity: 1; }

/* мобільне меню */
.mobile-menu { background: var(--bg); border-bottom: 1px solid var(--line); }
.mobile-menu__inner { display: flex; flex-direction: column; gap: 28px; padding: 20px var(--gutter) 32px; }
.mobile-menu__nav { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mobile-menu__nav a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 17px; color: var(--text); text-decoration: none; }
.mobile-menu__nav a[aria-current="page"] { color: var(--accent); }
.mobile-menu__nav a span + span { font-size: 13px; color: var(--text-3); }
.dir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; list-style: none; margin: 12px 0 0; padding: 0; }
.dir-grid a { display: flex; align-items: center; min-height: 44px; border-bottom: 1px dashed var(--line); font-family: var(--font-mono); font-size: 14px; line-height: 18px; color: var(--text-2); text-decoration: none; text-transform: lowercase; }
.dir-grid a::after { content: "/"; color: var(--text-3); }
.mobile-menu__foot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--font-mono); font-size: 13px; }
.mobile-menu__foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; }

/* 4 · ГОЛОВНА ------------------------------------------------------ */
.gridbg { position: relative; }
.gridbg::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
}
.gridbg > * { position: relative; }

.cmd { margin: 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.cmd__sign { margin-right: 8px; color: var(--accent); }

.intro { padding: 88px 0 64px; border-bottom: 1px solid var(--line); overflow: hidden; }
.display { margin: 16px 0 0; font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.lead { margin: 20px 0 0; max-width: 640px; font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--text-2); text-wrap: pretty; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: 80px; padding-block: 56px 96px; }
@media (max-width: 1040px) { .home-layout { grid-template-columns: minmax(0, 1fr); gap: 64px; } }
@media (max-width: 720px) {
  .intro { padding: 44px 0 40px; }
  .home-layout { padding-block: 32px 64px; gap: 56px; }
}

.label { display: flex; align-items: center; gap: 12px; margin: 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: 400; color: var(--text-3); }
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* запис у списку */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.entry > * { grid-column: 2; }
.entry__date { grid-column: 1; grid-row: 1; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); white-space: nowrap; transition: color var(--dur-fast) var(--ease); }
.entry__meta { grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.dot { color: var(--line-strong); }
.cat-link { position: relative; z-index: 1; color: var(--text-2); text-decoration: none; text-transform: lowercase; border-radius: var(--r-s); transition: color var(--dur-fast) var(--ease); }
.cat-link::before { content: "// "; }
.cat-link:hover { color: var(--accent); }
.entry__title { margin: 8px 0 0; font-size: var(--fs-entry); line-height: var(--lh-entry); font-weight: 600; letter-spacing: -.012em; text-wrap: pretty; }
.entry__title a { color: var(--text); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.entry__title a::after { content: ""; position: absolute; inset: 0; }
.entry__title a:focus-visible { outline: none; }
.entry:has(.entry__title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-s); }
.entry__arrow { display: inline-block; margin-left: 8px; color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.entry:hover .entry__title a { color: var(--accent); }
.entry:hover .entry__arrow { opacity: 1; transform: none; }
.entry:hover .entry__date { color: var(--text-2); }
.entry__excerpt { margin: 8px 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); text-wrap: pretty; }
.entry__foot { margin-top: 14px; }
@media (max-width: 720px) {
  .entry { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; padding: 24px 0; }
  .entry > * { grid-column: 1 / -1; }
  .entry__date { grid-column: 1; }
  .entry__meta { grid-column: 2; }
  .entry__meta::before { content: "·"; color: var(--line-strong); }
}

/* серії */
.series-bar {
  --seg: 4px; --total: 30; --done: 0;
  position: relative; display: inline-block; flex: none;
  width: calc(var(--seg) * var(--total)); height: 6px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 calc(var(--seg) - 1px), transparent calc(var(--seg) - 1px) var(--seg));
}
.series-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0;
  width: calc(var(--seg) * var(--done));
  background: repeating-linear-gradient(90deg, var(--accent) 0 calc(var(--seg) - 1px), transparent calc(var(--seg) - 1px) var(--seg));
}
.series-bar--wide { --seg: 12px; height: 8px; }
.series-progress { display: inline-flex; align-items: center; gap: 10px; }
.series-chip { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-s); font-family: var(--font-mono); font-size: 12.5px; line-height: 18px; color: var(--text-2); text-decoration: none; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.series-chip:hover { border-color: var(--accent-line); color: var(--text); }
.series-chip b { font-weight: 500; color: var(--text); }

.series-card { position: relative; display: block; margin-bottom: 8px; padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-raised); text-decoration: none; transition: border-color var(--dur) var(--ease); }
.series-card:hover { border-color: var(--accent-line); }
.series-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.series-card__title { margin: 12px 0 0; font-size: 22px; line-height: 30px; font-weight: 600; color: var(--text); }
.series-card__desc { margin: 6px 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.series-card__more { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--accent); }

.series-box { margin: 40px 0; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-raised); }
.series-box__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.series-box__head a { color: var(--text-2); text-decoration: none; }
.series-box__head a:hover { color: var(--accent); }
.series-box__title { margin: 8px 0 14px; font-size: 18px; line-height: 26px; font-weight: 600; }
.series-box__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; font-family: var(--font-mono); font-size: 13px; line-height: 18px; }
.series-box__list a, .series-box__list span { display: flex; flex-direction: column; gap: 2px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text-2); text-decoration: none; }
.series-box__list a:hover { border-color: var(--line-strong); color: var(--text); }
.series-box__list [aria-current="step"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.series-box__list small { font-size: 11.5px; color: var(--text-3); }

/* бічна колонка */
.widget + .widget { margin-top: 48px; }
.dir-list { list-style: none; margin: 12px 0 0; padding: 0; font-family: var(--font-mono); font-size: 14px; line-height: 20px; }
.dir-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 2px; border-bottom: 1px dashed var(--line); color: var(--text-2); text-decoration: none; text-transform: lowercase; transition: color var(--dur-fast) var(--ease); }
.dir-list a::after { content: "→"; flex: none; color: var(--text-3); opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.dir-list__name::after { content: "/"; color: var(--text-3); }
.dir-list a:hover { color: var(--accent); }
.dir-list a:hover::after { opacity: 1; }
.dir-list a[aria-current="page"] { color: var(--text); }

.series-list { display: grid; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.series-item { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.series-item:hover { border-color: var(--accent-line); background: var(--bg-raised); }
.series-item__name { display: block; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text); }
.series-item__meta { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.more-link { display: inline-flex; align-items: center; min-height: 36px; margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-2); text-decoration: none; }
.more-link:hover { color: var(--accent); }

/* 5 · ТЕГИ, ЧИПИ, КНОПКИ, ПАГІНАЦІЯ -------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-s); font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-2); text-decoration: none; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.tag::before { content: "#"; margin-right: 1px; color: var(--text-3); }
.tag:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag:hover::before { color: var(--accent); }
.tag:active { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 28px 0 0; padding: 0; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-m); font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-2); text-decoration: none; text-transform: lowercase; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-raised); }
.chip:active { background: var(--line); }
.chip[aria-current="page"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-m); font-family: var(--font-mono); font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-press); }
.btn--secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--secondary:hover { background: var(--bg-raised); border-color: var(--line-hover); }
.btn--secondary:active { background: var(--line); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--bg-raised); color: var(--text); }
.btn--ghost:active { background: var(--line); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn__key { font-size: 12px; font-weight: 400; opacity: .72; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 40px; font-family: var(--font-mono); font-size: 14px; }
.page-num { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text-2); text-decoration: none; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.page-num:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-raised); }
.page-num:active { background: var(--line); }
.page-num[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.page-num[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.page-gap { padding: 0 4px; color: var(--text-3); }
.pagination__next { margin-left: auto; }
@media (max-width: 720px) {
  .page-num { min-width: 44px; height: 44px; }
  .page-num--far { display: none; }
}

/* 6 · ФОРМИ -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label { font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-2); }
.field__label .req { color: var(--accent); }
.input, .textarea { width: 100%; min-height: 48px; padding: 12px 14px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 24px; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-error, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.input:disabled { opacity: .5; cursor: not-allowed; }
.textarea { min-height: 168px; resize: vertical; line-height: 26px; }
.field__hint { font-family: var(--font-mono); font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.field__hint--error { color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 22px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

/* 7 · АРХІВИ ------------------------------------------------------- */
.archive-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); overflow: hidden; }
.archive-head__title { margin: 16px 0 0; font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.archive-head__title .pre { margin-right: .3em; font-family: var(--font-mono); font-weight: 400; color: var(--text-3); }
.archive-head__desc { margin: 12px 0 0; max-width: 640px; font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--text-2); }
.archive-body { padding-block: 40px 96px; }
@media (max-width: 720px) {
  .archive-head { padding: 40px 0 32px; }
  .archive-body { padding-block: 24px 64px; }
  .series-card { padding: 20px; }
}

/* архів публікацій: вивід у стилі ls */
.year-jump { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 28px 0 0; padding: 0; font-family: var(--font-mono); font-size: 14px; }
.year-jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-m); color: var(--text-2); text-decoration: none; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.year-jump a:hover { color: var(--accent); border-color: var(--accent-line); }
.log-year { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 24px; padding-top: 40px; }
.log-year:first-child { padding-top: 0; }
.log-year__label { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; margin: 0; padding-top: 10px; font-family: var(--font-mono); font-size: 20px; line-height: 28px; font-weight: 600; color: var(--text); }
.log-year__label span { font-weight: 400; color: var(--text-3); }
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log-row { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 20px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.log-row__date { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-3); white-space: nowrap; }
.log-row__title { font-size: 16px; line-height: 24px; color: var(--text); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.log-row__title::after { content: ""; position: absolute; inset: 0; }
.log-row:hover .log-row__title { color: var(--accent); }
.log-row__cat { position: relative; z-index: 1; font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-3); text-decoration: none; text-transform: lowercase; white-space: nowrap; }
.log-row__cat:hover { color: var(--accent); }
.log-group > summary { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 20px; align-items: center; min-height: 47px; padding: 11px 0; border-bottom: 1px solid var(--line); list-style: none; cursor: pointer; font-size: 16px; line-height: 24px; color: var(--text-2); }
.log-group > summary::-webkit-details-marker { display: none; }
.log-group > summary:hover { color: var(--text); }
.log-group > summary:hover .caret { color: var(--accent); }
.caret { display: inline-block; font-family: var(--font-mono); font-size: 13px; color: var(--text-3); transition: transform var(--dur) var(--ease); }
details[open] > summary .caret { transform: rotate(90deg); }
.count-tag { margin-left: 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.year-folds { margin-top: 48px; border-top: 1px solid var(--line); }
.year-fold { border-bottom: 1px solid var(--line); }
.year-fold > summary { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; column-gap: 24px; align-items: center; min-height: 56px; list-style: none; cursor: pointer; }
.year-fold > summary::-webkit-details-marker { display: none; }
.year-fold__year { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--text-2); }
.year-fold__year span { font-weight: 400; color: var(--text-3); }
.year-fold__hint { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-3); }
.year-fold > summary:hover .year-fold__year { color: var(--text); }
.year-fold > summary:hover .year-fold__hint, .year-fold > summary:hover .caret { color: var(--accent); }
@media (max-width: 720px) {
  .log-year { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .log-year__label { position: static; padding: 0 0 12px; }
  .log-row { grid-template-columns: 48px minmax(0, 1fr); row-gap: 2px; padding: 12px 0; }
  .log-row__cat { grid-column: 2; }
  .log-group > summary { grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 20px; }
  .year-fold > summary { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 16px; }
}

/* 8 · ПОШУК І ТЕРМІНАЛ --------------------------------------------- */
.search-form { display: flex; gap: 12px; margin-top: 28px; max-width: 760px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field__sign { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: var(--accent); pointer-events: none; }
.input--search { height: 56px; padding-left: 42px; font-size: 18px; }
.search-form .btn { height: 56px; }
.results-meta { margin: 20px 0 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.results-meta b { font-weight: 500; color: var(--text); }
.hl { padding: 0 2px; border-radius: 2px; background: var(--accent-soft); color: var(--text); box-shadow: inset 0 -1px 0 var(--accent-line); }
.entry__title .hl { color: inherit; }
@media (max-width: 720px) {
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; height: 48px; }
}

.term { margin: 0; padding: 20px 24px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-l); font-family: var(--font-mono); font-size: 14px; line-height: 24px; color: var(--text-2); overflow-wrap: anywhere; }
.term__line { display: block; white-space: pre-wrap; }
.term .s { color: var(--accent); }
.term .c { color: var(--text); }
.term .e { color: var(--danger); }
.term .d { color: var(--text-3); }
.term .cursor { width: .6em; height: 1.15em; margin-left: 0; vertical-align: -.22em; }
.term-window { overflow: hidden; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-l); }
.term-window__bar { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.term-window .term { border: 0; border-radius: 0; background: none; }
@media (max-width: 720px) { .term { padding: 16px; font-size: 13px; line-height: 22px; } }

.empty { max-width: 760px; padding-bottom: 32px; }
.empty__title { margin: 32px 0 0; font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
.empty__text { margin: 8px 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.empty .chips { margin-top: 20px; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* 9 · ПОСТ --------------------------------------------------------- */
.post-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); overflow: hidden; }
.crumbs { margin: 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 6px; color: var(--line-strong); }
.post-title { margin: 20px 0 0; max-width: 920px; font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 600; letter-spacing: -.022em; text-wrap: balance; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 24px 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.post-meta a { color: var(--text-2); text-decoration: none; }
.post-meta a:hover { color: var(--accent); }
.post-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 220px; justify-content: space-between; column-gap: 64px; padding-block: 48px 96px; }
.post-main { min-width: 0; }

.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.toc__title { margin: 0 0 12px; font-size: inherit; font-weight: 400; color: var(--text-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 1px solid transparent; color: var(--text-3); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }
.toc .sub a { padding-left: 28px; }
.toc__top { display: inline-flex; align-items: center; min-height: 36px; margin-top: 16px; color: var(--text-3); text-decoration: none; }
.toc__top:hover { color: var(--accent); }
.toc-mobile { display: none; margin: 0 0 32px; border: 1px solid var(--line); border-radius: var(--r-l); }
.toc-mobile > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: 14px; color: var(--text-2); }
.toc-mobile > summary::-webkit-details-marker { display: none; }
.toc-mobile ol { list-style: none; margin: 0; padding: 0 16px 12px; font-family: var(--font-mono); font-size: 14px; }
.toc-mobile a { display: flex; align-items: center; min-height: 44px; border-top: 1px dashed var(--line); color: var(--text-2); text-decoration: none; }
@media (max-width: 1040px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; max-width: var(--measure); }
}
@media (max-width: 720px) {
  .post-head { padding: 32px 0 28px; }
  .post-layout { padding-block: 28px 64px; }
}

/* довгий текст */
.prose { max-width: var(--measure); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text); overflow-wrap: break-word; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 24px; }
.prose h2, .prose h3, .prose h4 { position: relative; font-weight: 600; color: var(--text); text-wrap: balance; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 { margin-top: 64px; font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: -.018em; }
.prose h3 { margin-top: 48px; font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -.012em; }
.prose h4 { margin-top: 40px; font-size: var(--fs-h4); line-height: var(--lh-h4); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 16px; }
.prose h2::before, .prose h3::before { position: absolute; right: calc(100% + 16px); font-family: var(--font-mono); font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--text-3); }
.prose h2::before { content: "##"; top: 10px; }
.prose h3::before { content: "###"; top: 6px; }
.prose p { text-wrap: pretty; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; text-underline-offset: 4px; border-radius: 2px; transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease); }
.prose a:hover { color: var(--accent-hover); text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.prose a:active { color: var(--accent-press); }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose :not(pre) > code, .icode { padding: .1em .38em; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg-sunken); font-family: var(--font-mono); font-size: .84em; color: var(--text); }
.prose ul, .prose ol { padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 32px; }
.prose li + li { margin-top: 10px; }
.prose ul > li::before { content: "–"; position: absolute; left: 6px; top: 0; font-family: var(--font-mono); color: var(--accent); }
.prose ol { counter-reset: li; }
.prose ol > li { counter-increment: li; padding-left: 40px; }
.prose ol > li::before { content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-size: 13px; line-height: var(--lh-body); color: var(--text-3); }

.prose blockquote { position: relative; margin: 40px 0; padding: 0 0 0 32px; }
.prose blockquote::before { content: ">"; position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-size: 22px; line-height: 34px; color: var(--accent); }
.prose blockquote p { margin: 0; font-size: 22px; line-height: 34px; letter-spacing: -.005em; color: var(--text); }
.prose blockquote footer { margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.prose blockquote cite { font-style: normal; }

.prose .figure, .figure { margin: 40px 0; }
.figure__media { display: block; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-raised); object-fit: cover; }
.figure figcaption { display: flex; gap: 10px; margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.figure__n { flex: none; color: var(--text-2); }
.ph { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background-color: var(--bg-raised); background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 24px 24px; }
.ph__label { padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-s); background: var(--bg); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }

.embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-raised); }
.embed iframe, .embed__poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__play { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; transition: background-color var(--dur-fast) var(--ease), transform var(--dur) var(--ease); }
.embed__play:hover { background: var(--accent-hover); transform: scale(1.05); }
.embed__play .ico { width: 26px; height: 26px; margin-left: 3px; fill: currentColor; stroke: none; }
.embed__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 12px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); }

/* блок коду */
.code { margin: 40px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-sunken); }
.code__bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.code__file { color: var(--text-2); }
.code__lang { margin-left: auto; padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--r-s); text-transform: lowercase; }
.code__copy { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.code__copy .ico { width: 15px; height: 15px; }
.code__copy:hover { color: var(--text); background: var(--bg-raised); border-color: var(--line); }
.code__copy:active { background: var(--line); }
.code__copy.is-copied { color: var(--ok); }
.code pre { margin: 0; padding: 16px 0; overflow-x: auto; white-space: normal; font-family: var(--font-mono); font-size: var(--fs-code); line-height: var(--lh-code); color: var(--text); tab-size: 4; }
.code code { display: block; min-width: max-content; counter-reset: ln; font-family: inherit; }
.code .ln { position: relative; display: block; min-height: var(--lh-code); padding: 0 24px 0 60px; white-space: pre; }
.code .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 40px; text-align: right; color: var(--text-3); opacity: .65; }
.code .ln.is-hl { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.tok-c { color: var(--syn-comment); font-style: italic; }
.tok-k { color: var(--syn-keyword); }
.tok-s { color: var(--syn-string); }
.tok-n { color: var(--syn-number); }
.tok-f { color: var(--syn-func); }
.tok-p { color: var(--syn-punct); }
@media (max-width: 720px) {
  .code__bar { padding: 4px 4px 4px 14px; }
  .code__copy { height: 44px; }
  .code .ln { padding: 0 16px 0 44px; }
  .code .ln::before { width: 28px; }
}

/* таблиця */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 24px; }
.table th { padding: 12px 16px; background: var(--bg-raised); border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--text-3); text-align: left; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.table td.num { color: var(--text); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--bg-raised) 70%, transparent); }

@media (max-width: 720px) {
  .prose h2::before, .prose h3::before { content: none; }
  .prose h2 { margin-top: 48px; }
  .prose h3 { margin-top: 40px; }
  .prose blockquote { padding-left: 24px; }
  .prose blockquote::before { font-size: 19px; line-height: 30px; }
  .prose blockquote p { font-size: 19px; line-height: 30px; }
  .prose .figure, .figure, .code, .series-box { margin: 32px 0; }
  .series-box__list { grid-template-columns: minmax(0, 1fr); }
}

/* теги, навігація, коментарі */
.post-foot { max-width: var(--measure); margin-top: 56px; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: var(--measure); margin-top: 40px; }
.post-nav__link { display: block; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-l); text-decoration: none; transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.post-nav__link:hover { border-color: var(--line-strong); background: var(--bg-raised); }
.post-nav__link--next { text-align: right; }
.post-nav__dir { display: block; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.post-nav__link:hover .post-nav__dir { color: var(--accent); }
.post-nav__title { display: block; margin-top: 8px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text); }

.comments { max-width: var(--measure); margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--line); }
.comments__title { display: flex; align-items: baseline; gap: 12px; margin: 0; font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
.comments__count { font-family: var(--font-mono); font-size: var(--fs-meta); font-weight: 400; color: var(--text-3); }
.comment-list { list-style: none; margin: 16px 0 0; padding: 0; }
.comment-item { border-bottom: 1px solid var(--line); }
.comment { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; padding: 24px 0; }
:is(.comment-children, .comment-list .children) { list-style: none; margin: 0; padding: 0 0 0 56px; }
:is(.comment-children, .comment-list .children) .comment { padding-top: 0; }
:is(.comment-children, .comment-list .children) .comment::before { content: "└─"; position: absolute; left: -36px; top: 8px; font-family: var(--font-mono); font-size: 14px; line-height: 20px; color: var(--line-hover); }
.avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg-raised); font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--text-2); }
.avatar--author { border-color: var(--accent-line); color: var(--accent); }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.comment__author { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--accent-line); border-radius: var(--r-s); font-family: var(--font-mono); font-size: 11.5px; line-height: 1; color: var(--accent); }
.comment__date { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); text-decoration: none; }
.comment__date:hover { color: var(--text-2); }
.comment__text { margin: 6px 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text); }
.comment__actions { display: flex; gap: 4px; margin: 6px 0 0 -8px; }
.reply-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border-radius: var(--r-s); font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-3); text-decoration: none; transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.reply-link:hover { color: var(--accent); background: var(--accent-soft); }

.comment-form { margin-top: 48px; }
.comment-form__title { margin: 0; font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 600; }
.comment-form__note { margin: 8px 0 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.comment-form__grid { display: grid; gap: 20px; margin-top: 24px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.comment-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
@media (max-width: 720px) {
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav__link { padding: 16px 20px; }
  .comments { margin-top: 56px; padding-top: 40px; }
  :is(.comment-children, .comment-list .children) { padding-left: 28px; }
  :is(.comment-children, .comment-list .children) .comment::before { content: "└"; left: -22px; }
  .reply-link { min-height: 44px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .comment-form__foot .btn { width: 100%; }
}

/* 10 · ПІДВАЛ ------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px 48px; }
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 -8px 0 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border-radius: var(--r-s); color: var(--text-2); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.footer-links a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .site-footer { padding: 32px 0 40px; }
  .site-footer__inner { flex-direction: column; }
  .footer-links { margin: 0 0 0 -8px; }
  .footer-links a { min-height: 44px; }
}

/* 11 · 404 --------------------------------------------------------- */
.nf { padding-block: 80px 112px; }
.nf__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.nf__code { margin: 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--accent); }
.nf__title { margin: 16px 0 0; font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.nf__text { margin: 16px 0 0; max-width: 520px; font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--text-2); }
.nf__langs { display: flex; flex-wrap: wrap; gap: 6px 0; list-style: none; margin: 24px 0 0; padding: 0; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.nf__langs li + li::before { content: "·"; margin: 0 10px; color: var(--line-strong); }
.nf__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.nf__search { margin-top: 32px; max-width: 480px; }
.nf__search .search-form { margin-top: 10px; }
.nf__search .input--search, .nf__search .btn { height: 48px; font-size: 16px; }
@media (max-width: 960px) {
  .nf__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .nf__term { order: -1; }
}
@media (max-width: 720px) {
  .nf { padding-block: 32px 64px; }
  .nf__actions .btn { flex: 1 1 auto; }
}

/* 12 · РУХ --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .site *, .site *::before, .site *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* 15 · WORDPRESS ---------------------------------------------------- */
html, body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
.nav__item { position: relative; }
.dropdown a[aria-current="page"] { color: var(--accent); }
.menu-btn__close, .menu-btn[aria-expanded="true"] .menu-btn__open { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__close { display: contents; }
@media (min-width: 721px) { .mobile-menu { display: none !important; } }

/* підсвітка коду: класи highlight.js → токени --syn-* */
.code .hljs-comment, .code .hljs-quote { color: var(--syn-comment); font-style: italic; }
.code .hljs-keyword, .code .hljs-built_in, .code .hljs-meta, .code .hljs-selector-tag, .code .hljs-type { color: var(--syn-keyword); }
.code .hljs-string, .code .hljs-regexp, .code .hljs-addition, .code .hljs-meta .hljs-string { color: var(--syn-string); }
.code .hljs-number, .code .hljs-literal, .code .hljs-symbol { color: var(--syn-number); }
.code .hljs-title, .code .hljs-function, .code .hljs-attr, .code .hljs-property { color: var(--syn-func); }
.code .hljs-punctuation, .code .hljs-operator { color: var(--syn-punct); }

/* пост без змісту — одна колонка */
.post-layout--solo { grid-template-columns: minmax(0, var(--measure)); }

/* класичний HTML у постах 2013–2020 */
.prose img { height: auto; border-radius: var(--r-m); }
.prose iframe { max-width: 100%; border: 0; }
.prose .aligncenter { margin-inline: auto; }
.prose .alignleft { float: left; margin: 6px 24px 16px 0; max-width: 50%; }
.prose .alignright { float: right; margin: 6px 0 16px 24px; max-width: 50%; }
.prose::after { content: ""; display: table; clear: both; }
.prose .wp-caption, .prose figure:not(.figure) { max-width: 100%; margin: 40px 0; }
.prose .wp-caption-text, .prose figure:not(.figure) > figcaption { margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-3); }
.prose .wp-block-embed { margin: 40px 0; }
.prose .wp-block-embed .figure { margin: 0; }
.prose .wp-block-embed__wrapper { position: static; }
.embed__poster { object-fit: cover; }
.pagination__prev { margin-right: auto; }

/* коментарі */
.comment__text p { margin: 0; }
.comment__text p + p { margin-top: 8px; }
.comment-respond .comment-reply-title small a { margin-left: 8px; font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-3); }

/* архів публікацій: вміст згорнутих років і груп серій */
.year-fold > .log { margin: 0 0 24px; }
.log-group > .log { border-top: 0; padding-left: 84px; }
.archive-tags { margin-top: 64px; }
.series-box__list .is-empty { opacity: .5; }
@media (max-width: 720px) { .log-group > .log { padding-left: 20px; } }
/* WordPress обгортає заголовок і форму в #respond — відступ переносимо на обгортку */
.comment-respond { margin-top: 48px; }
.comment-respond .comment-form { margin-top: 0; }
@media (max-width: 720px) { .series-bar--wide { --seg: 8px; } }
@media (max-width: 380px) { .series-bar--wide { --seg: 6px; } }
/* довгий шлях у промпті обрізається, курсор лишається видимим */
.prompt { min-width: 0; }
.prompt__path { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
