/* NixLife — основной стиль. Тёмная тема с фирменным зелёным. */
:root {
  --green: #00dd11;          /* NixLife_main */
  --green-2: #00a80d;        /* Nixlife-H */
  --green-3: #1c9e26;        /* NixLife_h */
  --green-soft: rgba(0, 221, 17, .12);
  --bg: #121314;
  --bg-2: #17191a;
  --surface: #1c1f20;
  --surface-2: #232628;
  --border: #2d3133;
  --border-2: #3a3f42;
  --text: #cfcfcf;           /* Nix-text */
  --text-strong: #f1f1f1;
  --muted: #8d9396;
  --warn: #f5b400;
  --danger: #ff5c5c;
  --info: #3fb6ff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --container: 1200px;
  --post: 780px;
  --header-h: 68px;
  --emoji-font: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla';
  --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif, var(--emoji-font);
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --accent: #00dd11;         /* заливка кнопок */
  --accent-hover: #3dff4b;
  --on-accent: #031b05;
  --green-line: rgba(0, 221, 17, .3);
  --green-hover-line: rgba(0, 221, 17, .45);
  --header-bg: rgba(14, 15, 16, .82);
  --panel-bg: rgba(14, 15, 16, .97);
  --section-alt: rgba(0, 0, 0, .25);
  --footer-bg: rgba(0, 0, 0, .45);
  --bg-overlay: rgba(14, 15, 16, .9);
  --inline-code: #7dff86;
  --row-hover: rgba(255, 255, 255, .02);
  --code-bg: #0b0c0d;
  --code-head: #1a1d1f;
  --code-border: #2d3133;
  color-scheme: dark;
}

/* ---------- Светлая тема ---------- */
:root[data-theme="light"] {
  --green: #0a8f16;          /* текст и заголовки: читаемый зелёный на белом */
  --green-2: #077a12;
  --green-3: #1c9e26;
  --green-soft: rgba(0, 190, 20, .1);
  --green-line: rgba(10, 143, 22, .3);
  --green-hover-line: rgba(10, 143, 22, .45);
  --accent: #00c80f;
  --accent-hover: #00b30e;
  --on-accent: #02240a;
  --bg: #f4f6f3;
  --bg-2: #eef1ec;
  --surface: #ffffff;
  --surface-2: #f1f4ef;
  --border: #e1e6de;
  --border-2: #cfd6cb;
  --text: #2c332e;
  --text-strong: #111713;
  --muted: #5e6862;
  --warn: #b77900;
  --danger: #d12f2f;
  --info: #0b7cc4;
  --shadow: 0 10px 30px rgba(30, 50, 35, .10);
  --header-bg: rgba(255, 255, 255, .85);
  --panel-bg: rgba(255, 255, 255, .98);
  --section-alt: rgba(255, 255, 255, .6);
  --footer-bg: #ffffff;
  --bg-overlay: rgba(246, 248, 245, .94);
  --inline-code: #0a7a14;
  --row-hover: rgba(0, 0, 0, .02);
  --code-bg: #111416;
  --code-head: #1c2023;
  --code-border: #2a2f32;
  color-scheme: light;
}
:root[data-theme="light"] a:hover { color: #067010; }
:root[data-theme="light"] .prose :not(pre) > code { background: #eef5ec; border-color: #d6e6d2; }
:root[data-theme="light"] .card, :root[data-theme="light"] .row,
:root[data-theme="light"] .cat-tile, :root[data-theme="light"] .toc--side,
:root[data-theme="light"] .author, :root[data-theme="light"] .stat { box-shadow: 0 1px 2px rgba(30, 50, 35, .05); }
:root[data-theme="light"] .cat-tile { background: linear-gradient(145deg, #ffffff, #f3f7f1); }
:root[data-theme="light"] .notfound__code { text-shadow: 0 0 40px rgba(0, 200, 15, .2); }

/* Логотип: две версии под тему */
.logo__light { display: none; }
:root[data-theme="light"] .logo__dark { display: none; }
:root[data-theme="light"] .logo__light { display: block; }

/* Переключатель темы */
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
html.theme-anim, html.theme-anim * { transition: background-color .25s, border-color .25s, color .25s !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.7 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(var(--bg-overlay), var(--bg-overlay)), url('../img/bg-asphalt.webp');
  background-size: auto, 249px;
  background-attachment: fixed, fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color .15s; }
a:hover { color: #5cff68; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0; font-weight: 700; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.i { width: 1em; height: 1em; flex: none; }
.muted { color: var(--muted); }
.accent { color: var(--green); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--post { max-width: calc(var(--post) + 48px); }

/* ---------- Кнопки, чипы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--ghost { background: transparent; border-color: var(--border-2); color: var(--text-strong); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; transition: .15s;
}
.icon-btn .i { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-2); color: var(--green); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 14px; line-height: 1.4; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  transition: .15s;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip--cat { background: var(--green-soft); color: var(--green); border-color: var(--green-line); font-weight: 500; }
.chip__n { font-size: 12px; opacity: .6; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta .i { width: 15px; height: 15px; opacity: .8; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: block; flex: none; }
.logo img { height: 36px; width: auto; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 15.5px;
}
.nav a:hover { color: var(--text-strong); background: var(--surface-2); }
.nav a.is-active { color: var(--green); }
.nav a.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 2px; background: var(--green); border-radius: 2px;
}
.header__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.burger { display: none; }

.search-panel { border-top: 1px solid var(--border); background: var(--panel-bg); }
.search-panel[hidden] { display: none; }
.search-form { display: flex; align-items: center; gap: 12px; height: 72px; }
.search-form > .i { width: 20px; height: 20px; color: var(--muted); }
.search-form input {
  flex: 1; min-width: 0; height: 44px; background: transparent; border: 0; color: var(--text-strong);
  font: inherit; font-size: 18px; outline: none;
}

/* ---------- Главная ---------- */
.hero { padding: 64px 0 40px; }
.hero__inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px;
  border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 500;
}
.hero__title { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.02em; margin-bottom: 18px; }
.hero__lead { font-size: 19px; color: var(--muted); max-width: 580px; margin-bottom: 28px; }
.hero__search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 6px 6px 6px 16px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; transition: border-color .15s;
}
.hero__search:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.hero__search > .i { width: 20px; height: 20px; color: var(--muted); }
.hero__search input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--text-strong); font: inherit; outline: none; }
.hero__search--page { margin: 20px 0 8px; }
.hero__cats { display: grid; gap: 16px; }
.cat-tile {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 22px;
  background: linear-gradient(145deg, var(--surface), var(--bg-2)); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); transition: .2s;
}
.cat-tile:hover { border-color: var(--green-hover-line); transform: translateY(-2px); color: var(--text); box-shadow: var(--shadow); }
.cat-tile__icon { grid-row: span 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.cat-tile__icon .i { width: 26px; height: 26px; }
.cat-tile__name { font-size: 21px; font-weight: 700; color: var(--text-strong); }
.cat-tile__desc { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.cat-tile__count { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--green); font-size: 14px; font-weight: 500; }

.section { padding: 48px 0; }
.section--tight { padding-top: 16px; }
.section--alt { background: var(--section-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__head--sub { margin: 48px 0 16px; }
.section__title { font-size: 26px; color: var(--green); letter-spacing: -.01em; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 15px; white-space: nowrap; }
.more .i { transition: transform .15s; }
.more:hover .i { transform: translateX(3px); }

/* ---------- Карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid--home { grid-template-columns: repeat(3, 1fr); }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--green-hover-line); transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__placeholder { display: grid; place-items: center; height: 100%; color: var(--green); }
.card__placeholder .i { width: 48px; height: 48px; }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card__title { font-size: 19px; font-weight: 700; line-height: 1.35; }
.card__title a { color: var(--text-strong); }
.card__title a::after { content: ''; position: absolute; inset: 0; }
.card__title a:hover { color: var(--green); }
.card__cats { position: relative; z-index: 1; }
.card__desc { font-size: 15px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; }
.card--big { grid-column: span 2; grid-row: span 2; }
.card--big .card__media { aspect-ratio: 16 / 9; }
.card--big .card__title { font-size: 28px; }
.card--big .card__desc { font-size: 16.5px; -webkit-line-clamp: 4; }
.card--big .card__body { padding: 24px 28px 28px; }

.list-compact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.row {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .2s;
}
.row:hover { border-color: var(--green-hover-line); color: var(--text); }
.row__thumb { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #000; }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row__title { font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--text-strong); }
.row:hover .row__title { color: var(--green); }
.row__desc { font-size: 14.5px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .meta { font-size: 13px; margin-top: auto; }

/* ---------- Заголовок страницы ---------- */
.page-head { padding: 36px 0 24px; }
.page-head__title { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em; margin: 8px 0 12px; }
.page-head__lead { color: var(--muted); font-size: 18px; max-width: 720px; }
.page-head__lead .muted { white-space: nowrap; margin-left: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green); }
.crumbs span[aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.crumbs__sep { opacity: .5; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border-2); }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pager__item { display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pager__item:hover { border-color: var(--green); }
.pager__item.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }

/* ---------- Статья ---------- */
.post__head { padding: 32px 0 8px; }
.post__head-inner { display: grid; grid-template-columns: minmax(0, var(--post)) 280px; justify-content: center; column-gap: 56px; }
.post__head-inner > * { grid-column: 1; }
.post__head-inner--single { grid-template-columns: minmax(0, var(--post)); }
.post__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 16px; }
.post__title { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -.02em; margin-bottom: 16px; }
.post__lead { font-size: 19px; line-height: 1.6; color: var(--muted); margin-bottom: 18px; }
.meta--post { font-size: 15px; padding-bottom: 8px; }
.post__layout { display: grid; grid-template-columns: minmax(0, var(--post)) 280px; justify-content: center; gap: 56px; padding-top: 24px; padding-bottom: 56px; }
.post__layout--single { grid-template-columns: minmax(0, var(--post)); }
.post__layout--wide { grid-template-columns: minmax(0, 1100px); }
.post__head-inner--wide { grid-template-columns: minmax(0, 1100px); }
.post__head-inner--wide .post__lead { max-width: var(--post); }
.post__layout--wide .prose > :not(.emoji):not(.nf):not(.cw):not(.table-wrap):not(.code),
.post__layout--wide .post__foot, .post__layout--wide .author, .post__layout--wide .post-nav,
.post__layout--wide .toc--mobile { max-width: var(--post); }
.post__layout--wide .prose > .table-wrap, .post__layout--wide .prose > .code { max-width: 900px; }
.post__main { min-width: 0; }
.post__cover { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.post__cover img { width: 100%; max-height: 520px; object-fit: cover; }
.post__side { position: relative; }

.toc--side { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toc__title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc__item a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 14.5px; line-height: 1.4; color: var(--text); border-left: 2px solid transparent; }
.toc__item a:hover { background: var(--surface-2); color: var(--text-strong); }
.toc__item a.is-active { color: var(--green); background: var(--green-soft); border-left-color: var(--green); }
.toc__item--h3 a { padding-left: 38px; font-size: 13.5px; color: var(--muted); }
.toc__n { flex: none; min-width: 18px; color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.toc--mobile { display: none; margin: 0 0 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toc--mobile summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 700; cursor: pointer; list-style: none; color: var(--text-strong); }
.toc--mobile summary::-webkit-details-marker { display: none; }
.toc--mobile summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .2s; }
.toc--mobile[open] summary::after { transform: rotate(180deg); }
.toc--mobile .toc__list { padding: 0 10px 14px; }

/* Типографика текста статьи */
.prose { font-size: 18px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; margin-top: 2em; padding-top: .2em; color: var(--green); letter-spacing: -.01em; }
.prose h3 { font-size: 22px; margin-top: 1.7em; color: var(--text-strong); }
.prose h4 { font-size: 18px; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose strong { color: var(--text-strong); font-weight: 700; }
.prose a { text-decoration: underline; text-decoration-color: var(--green-line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--green); }
.prose ol > li::marker { font-weight: 700; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .86em; padding: .15em .45em; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--inline-code);
}
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--green); color: var(--muted); font-style: italic; }
.prose .buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.prose .btn { text-decoration: none; }

.figure { margin: 1.8em 0; }
.figure img { border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 0 auto; cursor: zoom-in; }
.figure figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); color: var(--text-strong); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: var(--row-hover); }

/* Блоки кода */
.code { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--code-border); background: var(--code-bg); }
.code__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; background: var(--code-head); border-bottom: 1px solid var(--code-border); }
.code__title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8d9396; font-family: var(--mono); }
.code__title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #00dd11; box-shadow: 0 0 8px rgba(0, 221, 17, .6); }
.code__copy {
  padding: 4px 10px; font-size: 13px; border-radius: 6px; background: transparent; border: 1px solid #3a3f42;
  color: #cfcfcf; cursor: pointer; transition: .15s;
}
.code__copy:hover { border-color: #00dd11; color: #00dd11; }
.code__copy.is-done { background: #00dd11; border-color: #00dd11; color: #031b05; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 15px/1.65 var(--mono); color: #e6e6e6; tab-size: 4; }
.code code { font-family: inherit; }
.t-cmd { color: #5cff68; font-weight: 600; }
.t-flag { color: #7cc4ff; }
.t-str { color: #ffd479; }
.t-var { color: #ff9ee0; }
.t-op { color: #ff8a65; }
.t-com { color: #6e7679; font-style: italic; }
.t-key { color: #7cc4ff; }

/* Подсказки */
.callout { --c: var(--info); margin: 1.6em 0; padding: 16px 20px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c) 9%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-left: 4px solid var(--c); }
.callout--note, .callout--info { --c: var(--info); }
.callout--tip { --c: var(--green); }
.callout--warning { --c: var(--warn); }
.callout--danger { --c: var(--danger); }
.callout__title { font-weight: 700; color: var(--c); margin-bottom: 4px; font-size: 16px; }
.callout__body { font-size: 16.5px; }
.callout__body > * + * { margin-top: .6em; }

.post__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { color: var(--muted); font-size: 14px; margin-right: 4px; }
.share__btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; cursor: pointer; }
.share__btn:hover { border-color: var(--green); color: var(--green); }
.share__btn .i { width: 16px; height: 16px; }
.share__btn--fav.is-done { border-color: var(--green); color: var(--green); }
.share__btn--fav.is-done .i { fill: currentColor; }
.tags--small .chip { font-size: 13px; }

.author { display: flex; gap: 16px; align-items: flex-start; margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.author img { border-radius: 12px; }
.author__name { font-weight: 700; color: var(--text-strong); }
.author__text { font-size: 15px; color: var(--muted); line-height: 1.55; margin-top: 2px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav__item { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.post-nav__item:hover { border-color: var(--green); }
.post-nav__item--next { text-align: right; align-items: flex-end; }
.post-nav__label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.post-nav__title { color: var(--text-strong); font-weight: 500; line-height: 1.4; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* О проекте */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.stat { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat__n { display: block; font-size: 34px; font-weight: 700; color: var(--green); line-height: 1.1; }
.stat__l { font-size: 14px; color: var(--muted); }

/* 404 */
.notfound { padding: 72px 0 56px; text-align: center; }
.notfound .page-head__lead { margin: 0 auto; }
.notfound .hero__search { margin: 28px auto 20px; text-align: left; }
.notfound__code { font: 700 clamp(90px, 16vw, 160px)/1 var(--mono); color: var(--green); text-shadow: 0 0 40px rgba(0, 221, 17, .35); }


/* ---------- Подборка эмодзи ---------- */
.emoji { --em-size: 30px; margin: 1.6em 0 2.4em; position: relative; }
.emoji__bar {
  position: sticky; top: var(--header-h); z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
  margin: 0 -12px; padding: 12px; background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.emoji__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.emoji__search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; cursor: text;
}
.emoji__search:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.emoji__search .i { width: 18px; height: 18px; color: var(--muted); }
.emoji__search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text-strong); font: inherit; font-size: 16px; outline: none; }
.emoji__found { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.emoji__tones { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; }
.emoji__tone { width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.emoji__tone:hover { background: var(--surface-2); }
.emoji__tone.is-active { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); }
.emoji__tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.emoji__tabs::-webkit-scrollbar { display: none; }
.emoji__tabs a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border-radius: 9px; color: var(--text); font-size: 20px; line-height: 1; text-decoration: none;
  border: 1px solid transparent;
}
.emoji__tabs a[hidden] { display: none; }
.emoji__tab-name { display: none; font-size: 13px; font-weight: 500; }
.emoji__tabs a:hover { background: var(--surface-2); color: var(--text-strong); }
.emoji__tabs a.is-active { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.emoji__tabs a.is-active .emoji__tab-name { display: inline; }
.emoji__tabs a.is-off { opacity: .3; pointer-events: none; }
.emoji__tray { display: flex; gap: 8px; align-items: center; }
.emoji__tray input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; font: inherit; font-size: 18px;
  color: var(--text-strong); background: var(--surface); border: 1px dashed var(--border-2); outline: none;
}
.emoji__tray input::placeholder { font-size: 14px; color: var(--muted); }
.emoji__tray input:focus { border-style: solid; border-color: var(--green); }
.emoji__copy { height: 40px; padding: 0 16px; }

.emoji__group { scroll-margin-top: 220px; margin-top: 26px; }
.emoji__group[hidden] { display: none; }
.prose .emoji__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0; font-size: 20px; color: var(--text-strong); letter-spacing: 0; }
.emoji__n { font-size: 13px; font-weight: 500; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.prose .emoji__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px; margin: 0; }
.em {
  display: grid; place-items: center; aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px;
  background: transparent; font-size: var(--em-size); line-height: 1; cursor: pointer; padding: 0;
  font-family: var(--emoji-font), sans-serif;
  transition: transform .12s, background-color .12s;
}
.em[hidden] { display: none; }
.em:hover, .em:focus-visible { background: var(--surface-2); border-color: var(--border); transform: scale(1.15); outline: none; }
.em:focus-visible { border-color: var(--green); }
.em.is-pop { animation: em-pop .35s ease; }
@keyframes em-pop { 40% { transform: scale(1.35); background: var(--green-soft); } }
.emoji__empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--radius); }
.emoji__toast, .toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 12px;
  background: var(--text-strong); color: var(--bg); font-size: 15px; box-shadow: var(--shadow); transition: .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emoji__toast .muted, .toast .muted { color: inherit; opacity: .65; }
.toast { white-space: normal; text-align: center; }
.toast kbd { color: var(--text-strong); }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.emoji__toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.emoji__toast-e { font-size: 22px; line-height: 1; }


/* ---------- Генератор шрифтов для ника ---------- */
.nf { margin: 1.6em 0 2.4em; max-width: 960px; }
.nf__bar {
  position: sticky; top: var(--header-h); z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  margin: 0 -12px; padding: 14px 12px; background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.nf__field {
  display: flex; align-items: center; gap: 6px; padding: 0 6px 0 16px; height: 58px;
  background: var(--surface); border: 2px solid var(--green-line); border-radius: 14px;
}
.nf__field:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.nf__input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 500 22px/1 var(--font); color: var(--text-strong); }
.nf__input::placeholder { color: var(--muted); font-weight: 400; }
.nf__opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: 14.5px; }
.nf__switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.nf__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nf__switch-ui { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--border-2); transition: .2s; }
.nf__switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.nf__switch input:checked + .nf__switch-ui { background: var(--accent); }
.nf__switch input:checked + .nf__switch-ui::after { transform: translateX(18px); }
.nf__switch input:focus-visible + .nf__switch-ui { outline: 2px solid var(--green); outline-offset: 2px; }
.nf__frame { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.nf__frame select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-strong); font: inherit; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.nf__groups { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nf__groups::-webkit-scrollbar { display: none; }
.nf__groups .chip { flex: none; cursor: pointer; font: inherit; font-size: 14px; }

.prose .nf__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.prose .nf__row { margin: 0; }
.nf__row { display: flex; align-items: stretch; gap: 8px; }
.nf__row[hidden] { display: none; }
.nf__pick {
  flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit;
  transition: border-color .15s, background-color .15s;
}
.nf__pick:hover, .nf__pick:focus-visible { border-color: var(--green-hover-line); outline: none; }
.nf__name { font-size: 13px; color: var(--muted); }
.nf__badge { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.nf__out {
  font-size: 24px; line-height: 1.35; color: var(--text-strong); overflow-wrap: anywhere; min-height: 1.35em;
  font-family: 'Segoe UI Symbol', 'Cambria Math', 'STIX Two Math', 'Noto Sans Math', 'DejaVu Math TeX Gyre', var(--font);
}
.nf__copy { align-self: center; height: 40px; }
.nf__row.is-copied .nf__pick { border-color: var(--green); background: var(--green-soft); }
.nf__row.is-copied .nf__copy { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }


/* ---------- Конвертер цветов ---------- */
.cw { --cur: #00dd11; --cur-t: #000; margin: 1.6em 0 2.4em; max-width: 1100px; }
.cw__main { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 20px; }
.cw__preview {
  position: relative; min-height: 240px; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background-color: var(--surface);
  background-image: linear-gradient(var(--cur), var(--cur)),
    repeating-conic-gradient(#bfbfbf 0 25%, #fff 0 50%);
  background-size: auto, 20px 20px;
  color: var(--cur-t); transition: color .2s;
}
.cw__native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.cw__big { font: 700 34px/1 var(--mono); letter-spacing: .02em; pointer-events: none; }
.cw__hint { font-size: 13px; opacity: .75; pointer-events: none; }
.cw__controls { display: grid; gap: 12px; align-content: start; min-width: 0; }
.cw__label { font-size: 14px; color: var(--muted); }
.cw__field input {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--green-line);
  background: var(--surface); color: var(--text-strong); font: 600 20px/1 var(--mono); outline: none;
}
.cw__field input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.cw__field input[aria-invalid] { border-color: var(--danger); }
.prose .cw__error { margin: 0; font-size: 14px; color: var(--danger); }
.cw__alpha { display: grid; grid-template-columns: auto 1fr 48px; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.cw__alpha input { width: 100%; accent-color: var(--accent); }
.cw__alpha output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.cw__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cw__actions .btn { height: 40px; padding: 0 14px; font-size: 14px; }
.cw__actions .btn[hidden] { display: none; }

.cw__formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 20px; }
.cw__fmt {
  position: relative; display: grid; gap: 4px; padding: 10px 14px; text-align: left; cursor: pointer; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit;
}
.cw__fmt:hover, .cw__fmt:focus-visible { border-color: var(--green-hover-line); outline: none; }
.cw__fmt-label { font-size: 12.5px; color: var(--muted); }
.prose .cw__fmt-value { padding: 0; border: 0; background: none; color: var(--text-strong); font: 600 15px/1.4 var(--mono); overflow-wrap: anywhere; }
.cw__fmt-copy { position: absolute; top: 9px; right: 12px; font-size: 12px; color: var(--green); opacity: 0; transition: opacity .15s; }
.cw__fmt:hover .cw__fmt-copy { opacity: 1; }
.cw__fmt.is-copied { border-color: var(--green); background: var(--green-soft); }
.cw__fmt.is-copied .cw__fmt-copy { opacity: 1; }

.cw__block { margin-top: 36px; }
.cw__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.prose .cw__title { margin: 0 0 12px; padding: 0; font-size: 21px; color: var(--text-strong); letter-spacing: 0; }
.prose .cw__head .cw__title { margin: 0; }
.cw__export { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.cw__export .chip { cursor: pointer; font: inherit; font-size: 13px; }
.cw__export .chip.is-copied { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.cw__shades { display: grid; grid-template-columns: repeat(11, 1fr); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.cw__sw {
  min-height: 84px; padding: 8px 4px; border: 0; background: var(--c); color: var(--t); cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center; font: 600 11.5px/1.3 var(--mono); transition: transform .12s;
}
.cw__sw span { display: grid; gap: 2px; text-align: center; }
.cw__sw b { font: 700 13px/1 var(--font); }
.cw__sw:hover, .cw__sw:focus-visible { transform: scale(1.06); position: relative; z-index: 1; outline: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.cw__sw.is-copied span::after { content: '✓ скопировано'; display: block; font-size: 10px; }
.cw__harmonies { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cw__harmony { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cw__harmony-name { margin-bottom: 10px; font-size: 14px; line-height: 1.4; }
.cw__harmony-name b { color: var(--text-strong); }
.cw__harmony-name span { color: var(--muted); }
.cw__row { display: flex; border-radius: 10px; overflow: hidden; }
.cw__row .cw__sw { flex: 1; min-height: 64px; }

.cw__contrast { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.cw__sample { display: grid; gap: 8px; align-content: center; padding: 24px; min-height: 160px; border-radius: var(--radius); border: 1px solid var(--border); }
.cw__sample-big { font-size: 28px; font-weight: 700; line-height: 1.2; }
.cw__sample-small { font-size: 16px; line-height: 1.5; }
.cw__contrast-side { display: grid; gap: 12px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cw__pair { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 14px; }
.cw__pair label { display: inline-flex; align-items: center; gap: 8px; }
.cw__pair input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--border-2); border-radius: 8px; background: none; cursor: pointer; }
.cw__pair-bg { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); width: 100%; }
.cw__pair .chip { cursor: pointer; font: inherit; font-size: 13px; }
.cw__ratio { font: 700 44px/1 var(--mono); color: var(--text-strong); }
.cw__ratio small { font-size: 18px; color: var(--muted); }
.prose .cw__badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.prose .cw__badges li { margin: 0; padding: 6px 10px; border-radius: 8px; font-size: 13px; border: 1px solid var(--border); }
.cw__badges li::before { content: '•'; margin-right: 6px; }
.cw__badges li.is-ok { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.cw__badges li.is-ok::before { content: '✓'; }
.cw__badges li.is-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.cw__badges li.is-bad::before { content: '✗'; }
.cw__badges b { font-family: var(--mono); font-weight: 600; }

.cw__named { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.cw__name {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 12px; text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit;
}
.cw__name:hover { border-color: var(--green-hover-line); }
.cw__name .cw__dot { grid-row: span 2; width: 30px; height: 30px; }
.cw__name-ru { font-size: 14.5px; font-weight: 500; color: var(--text-strong); }
.prose .cw__name code { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.cw__name small { grid-column: 2; font-size: 12px; color: var(--muted); }
.cw__dot { display: inline-block; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .45); }
.emoji__toast .cw__dot { width: 18px; height: 18px; }
:root[data-theme="light"] .prose .cw__fmt-value,
:root[data-theme="light"] .prose .cw__name code { background: none; border: 0; }
:root[data-theme="light"] .prose .cw__fmt-value { color: var(--text-strong); }
:root[data-theme="light"] .prose .cw__name code { color: var(--muted); }
.color-chip { display: inline-block; width: .95em; height: .95em; margin-right: .35em; vertical-align: -.1em; border-radius: 4px; border: 1px solid rgba(128, 128, 128, .45); }

/* Таблица с эмодзи в тексте */
.big-emoji, .emoji__tone, .emoji__tabs a, .emoji__toast-e, .emoji__title > span[aria-hidden] { font-family: var(--emoji-font), sans-serif; }
.big-emoji { font-size: 26px; line-height: 1; }
kbd {
  display: inline-block; padding: 1px 7px; border-radius: 6px; font: 600 .82em/1.6 var(--mono);
  color: var(--text-strong); background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px;
}

/* ---------- Подвал ---------- */
.footer { margin-top: 0; padding-top: 48px; background: var(--footer-bg); border-top: 1px solid var(--border); font-size: 15px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer__brand p { margin-top: 14px; color: var(--muted); max-width: 420px; line-height: 1.6; }
.footer__title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__links a { color: var(--text); }
.footer__links a:hover { color: var(--green); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }

.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--green); cursor: pointer; box-shadow: var(--shadow); }
.to-top[hidden] { display: none; }
.to-top .i { width: 20px; height: 20px; }

/* Лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .9); cursor: zoom-out; }
.lightbox img { max-height: 92vh; width: auto; border-radius: 8px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .post__layout { grid-template-columns: minmax(0, var(--post)); }
  .post__side { display: none; }
  .post__head-inner { grid-template-columns: minmax(0, var(--post)); }
  .post__layout--wide, .post__head-inner--wide { grid-template-columns: minmax(0, 1100px); }
  .toc--mobile { display: block; }
}
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__cats { grid-template-columns: repeat(3, 1fr); }
  .cw__main, .cw__contrast { grid-template-columns: 1fr; }
  .cw__shades { grid-template-columns: repeat(6, 1fr); }
  .grid, .grid--home, .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .list-compact { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .burger { display: inline-grid; }
  .hide-sm { display: none; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--panel-bg); border-bottom: 1px solid var(--border); display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 8px; font-size: 17px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav a.is-active::after { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .logo img { height: 30px; }
  .hero { padding: 36px 0 24px; }
  .hero__lead { font-size: 17px; }
  .hero__cats { grid-template-columns: 1fr; }
  .hero__search .btn { padding: 0 14px; }
  .grid, .grid--home, .grid--3 { grid-template-columns: 1fr; gap: 16px; }
  .card--big { grid-column: auto; grid-row: auto; }
  .card--big .card__title { font-size: 22px; }
  .card--big .card__body { padding: 18px 20px 20px; }
  .row { grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; }
  .row__desc { display: none; }
  .section { padding: 36px 0; }
  .section__title { font-size: 22px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 23px; }
  .prose h3 { font-size: 19px; }
  .code pre { font-size: 13.5px; padding: 14px; }
  .post__lead { font-size: 17px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { text-align: left; align-items: flex-start; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .crumbs span[aria-current] { max-width: 24ch; }
  .search-form .btn { display: none; }
  .emoji { --em-size: 28px; }
  .post__head-inner--wide .post__lead { display: none; }
  .emoji__bar { margin: 0 -8px; padding: 8px; gap: 8px; }
  .emoji__tones { width: 100%; justify-content: space-between; }
  .emoji__tone { flex: 1; }
  .prose .emoji__grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; }
  .emoji__tray input::placeholder { font-size: 12px; }
  .emoji__group { scroll-margin-top: 260px; }
  .nf__bar { margin: 0 -8px; padding: 10px 8px; gap: 10px; }
  .nf__field { height: 50px; }
  .nf__input { font-size: 19px; }
  .nf__copy { display: none; }
  .nf__out { font-size: 21px; }
  .nf__opts { font-size: 13.5px; }
  .cw__main, .cw__contrast { grid-template-columns: 1fr; }
  .cw__preview { min-height: 150px; }
  .cw__big { font-size: 28px; }
  .cw__shades { grid-template-columns: repeat(4, 1fr); }
  .cw__sw { min-height: 64px; }
  .cw__harmonies { grid-template-columns: 1fr; }
  .cw__formats { grid-template-columns: 1fr; }
  .cw__fmt-copy { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
