/* zublite — стили сайта и админки */

:root {
  --bg: #0c090b;
  --bg-2: #130e12;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --solid: #1a1218;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #fbf3f7;
  --muted: #ab98a3;
  --faint: #6b5a64;
  --violet: #f472b6;
  --cyan: #fda4af;
  --accent: var(--violet);
  --accent-ink: #1a0a12;
  --grad: linear-gradient(100deg, #fbcfe8 0%, #f472b6 45%, #fb7185 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #fdf6f9;
  --bg-2: #ffffff;
  --surface: rgba(80, 10, 40, .03);
  --surface-2: rgba(80, 10, 40, .06);
  --solid: #ffffff;
  --line: rgba(80, 10, 40, .09);
  --line-2: rgba(80, 10, 40, .16);
  --text: #1f0f17;
  --muted: #6e5562;
  --faint: #a8919d;
  --violet: #db2777;
  --cyan: #e11d48;
  --accent-ink: #ffffff;
  --grad: linear-gradient(100deg, #ec4899 0%, #db2777 45%, #e11d48 100%);
  --ok: #059669;
  --shadow: 0 30px 70px -35px rgba(120, 20, 60, .25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
kbd { font: 500 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); background: var(--surface); }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 16px; }

.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-glow::before, .bg-glow::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22;
}
.bg-glow::before { background: radial-gradient(circle, #ec4899, transparent 60%); top: -30vmax; left: -15vmax; animation: drift 24s ease-in-out infinite alternate; }
.bg-glow::after { background: radial-gradient(circle, #f43f5e, transparent 60%); top: 10vmax; right: -30vmax; opacity: .14; animation: drift 30s ease-in-out infinite alternate-reverse; }
[data-theme="light"] .bg-glow::before { opacity: .12; }
[data-theme="light"] .bg-glow::after { opacity: .08; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); opacity: .5;
}
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* ---------- Типографика ---------- */
.display { font: 800 clamp(38px, 6.4vw, 78px)/1.02 var(--display); letter-spacing: -.035em; margin: 0 0 22px; text-wrap: balance; }
.display-sm { font: 700 clamp(30px, 4.4vw, 52px)/1.08 var(--display); letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.h2 { font: 700 clamp(26px, 3.2vw, 38px)/1.1 var(--display); letter-spacing: -.025em; margin: 0; }
.h3 { font: 700 20px/1.3 var(--font); margin: 6px 0; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.eyebrow { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 14px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 14px;
  font-weight: 700; font-size: 15px; border: 1px solid transparent; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); background: var(--surface-2); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-right: 8px; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; color: var(--muted); margin: 0 0 26px; max-width: 100%; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid transparent; transition: border-color .3s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 800 24px/1 var(--font); letter-spacing: -.06em; color: var(--text); }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { padding-right: .06em; }
.brand-lite { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; transition: color .2s, background .2s; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); }
.top-actions { display: flex; gap: 8px; }
.search-open kbd { margin-left: 2px; }
.menu-btn { display: none; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: clamp(48px, 9vh, 110px) 0 clamp(60px, 10vh, 120px); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.stats { display: flex; gap: clamp(24px, 5vw, 56px); margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font: 700 clamp(28px, 3.4vw, 40px)/1 var(--display); letter-spacing: -.03em; }
.stats dt { color: var(--muted); font-size: 14px; margin-top: 6px; }

.hero-visual { position: relative; }
.term { position: relative; z-index: 1; border-radius: var(--radius); background: color-mix(in srgb, var(--solid) 88%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(10px); transform: rotate(-1.5deg); transition: transform .5s var(--ease); }
.term:hover { transform: rotate(0); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; font: 12px var(--mono); color: var(--muted); }
.term-body { margin: 0; padding: 20px 22px 26px; font: 14px/1.85 var(--mono); color: var(--text); white-space: pre-wrap; min-height: 270px; }
.t-p { color: var(--accent); } .t-o { color: var(--muted); } .t-d { color: var(--cyan); } .t-ok { color: var(--ok); }
.caret { display: inline-block; width: 9px; height: 17px; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.orbit { position: absolute; inset: -40px; z-index: 0; pointer-events: none; }
.orbit span { position: absolute; border-radius: 50%; border: 1px dashed var(--line-2); inset: 0; animation: spin 40s linear infinite; }
.orbit span:nth-child(2) { inset: 40px; animation-duration: 28s; animation-direction: reverse; }
.orbit span:nth-child(3) { inset: auto; width: 14px; height: 14px; border: 0; background: var(--grad); top: 12%; right: 4%; box-shadow: 0 0 30px var(--violet); animation: float 6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-18px); } }

/* ---------- Секции ---------- */
.section { padding: clamp(56px, 9vh, 100px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { padding: 8px 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; transition: all .2s; }
.filter:hover { color: var(--text); border-color: var(--line-2); }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }
.empty .mono { color: var(--accent); }
.empty p { margin: 8px 0 0; }

/* Проекты */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: border-color .3s, transform .3s var(--ease), box-shadow .3s; transform-style: preserve-3d;
}
.project::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%); opacity: 0; transition: opacity .3s; }
.project:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.project:hover::before { opacity: 1; }
.project.is-hidden { display: none; }
.project-media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project:hover .project-media img { transform: scale(1.04); }
.project-mono { height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, hsl(var(--h) 70% 55% / .35), transparent 60%), radial-gradient(circle at 80% 90%, hsl(calc(var(--h) - 25) 80% 60% / .25), transparent 55%); }
.project-mono span { font: 800 54px var(--display); letter-spacing: -.04em; color: var(--text); opacity: .85; }
.badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line-2); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.badge-live i { background: var(--ok); } .badge-dev i { background: var(--warn); }
.badge.is-up i { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.badge.is-down i { background: var(--bad); }
.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-cat { font: 500 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.project h3 { font: 700 21px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 4px; }
.project-body .mono { margin: 0 0 12px; }
.project-desc { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; }
.tags li { font: 12px var(--mono); padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.project-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); width: fit-content; }
.project-link::after { content: ""; position: absolute; inset: 0; }
.project-link svg { transition: transform .25s var(--ease); }
.project:hover .project-link svg { transform: translate(3px, -3px); color: var(--accent); }

/* Статьи */
.articles { display: grid; grid-template-columns: 1.3fr 1fr; grid-auto-rows: auto; gap: 20px; }
.article-card { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, transform .3s var(--ease); }
.article-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.article-card.is-lead { grid-row: span 3; grid-template-columns: 1fr; }
.article-card.is-lead .article-cover { aspect-ratio: 16 / 9; height: auto; }
.article-card.is-lead h3 { font-size: 26px; }
.article-cover, .row-cover { border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; height: 110px; color: var(--accent); font-size: 22px; }
.article-cover img, .row-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body h3 { font: 700 19px/1.3 var(--display); letter-spacing: -.015em; margin: 8px 0; }
.article-body p { margin: 0; font-size: 15px; }
.meta { font-size: 13px; color: var(--muted); margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* Программы */
.programs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.program { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.program-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.program-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--grad); color: #1a0a12; font: 800 22px var(--display); flex: none; }
.program h3 { font: 700 20px var(--display); margin: 0; letter-spacing: -.02em; }
.program h3 .ver { font: 500 13px var(--mono); color: var(--accent); margin-left: 6px; }
.program > p { color: var(--muted); margin: 0 0 14px; }
.program-top p { margin: 4px 0 0; }
.notes { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.notes summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.notes p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.program-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hash { border: 1px dashed var(--line-2); background: none; border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.hash:hover { border-color: var(--accent); color: var(--text); }

/* Обо мне */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: clamp(28px, 5vw, 56px); border-radius: 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 12%, transparent), transparent 55%), var(--surface); border: 1px solid var(--line); }
.about .lead { margin-bottom: 26px; }
.contacts { display: flex; gap: 10px; flex-wrap: wrap; }
.stack-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.stack-list li { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; transition: border-color .2s, transform .2s var(--ease); }
.stack-list li:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Подвал */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0 50px; }
.footer-in { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; }
.footer-brand p { margin: 10px 0 0; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-in > .small { grid-column: 1 / -1; margin: 0; }

/* ---------- Список статей и статья ---------- */
.page-head { margin-bottom: 40px; }
.article-list { display: grid; gap: 14px; }
.row-card { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.row-card:hover { border-color: var(--line-2); transform: translateX(4px); }
.row-card .row-cover { height: 120px; }
.row-card p.muted { margin: 0; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: var(--grad); }
.article-page { padding: 50px 0 40px; }
.article-hero { max-width: 820px; margin: 0 auto 36px; }
.back { display: inline-block; color: var(--muted); font-weight: 600; margin-bottom: 26px; }
.back:hover { color: var(--text); }
.article-hero .meta { margin-bottom: 18px; }
.article-cover-full { margin: 0 auto 50px; max-width: 1000px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 50px; justify-content: center; }
.article-layout:has(.toc[hidden]) { grid-template-columns: minmax(0, 760px); }
.toc { position: sticky; top: 100px; align-self: start; font-size: 14px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc a.lvl-3 { padding-left: 28px; font-size: 13px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); border-left-color: var(--accent); }
.prose { font-size: 18px; line-height: 1.8; }
.prose > * { margin: 0 0 1.1em; }
.prose h2 { font: 700 28px/1.25 var(--display); letter-spacing: -.02em; margin: 2em 0 .7em; }
.prose h3 { font: 700 21px/1.3 var(--font); margin: 1.6em 0 .6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose code { font: .86em var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { position: relative; background: var(--solid); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font: 14px/1.7 var(--mono); }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { border-radius: 14px; border: 1px solid var(--line); }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2.5em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.copy-code { position: absolute; top: 10px; right: 10px; font: 600 12px var(--font); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); opacity: 0; transition: opacity .2s; }
.prose pre:hover .copy-code { opacity: 1; }
.share { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; max-width: 760px; margin: 50px auto 0; padding-top: 30px; border-top: 1px solid var(--line); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 30px auto 0; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.pager a:hover { border-color: var(--line-2); }
.pager a.next { text-align: right; grid-column: 2; }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); margin: 0 0 20px; }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.notice.err { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* Заглушки */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.status-card { width: min(560px, 100%); text-align: center; padding: clamp(32px, 6vw, 56px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.status-card .brand { margin-bottom: 30px; }
.status-card .lead { margin-inline: auto; }
.status-orb { width: 90px; height: 90px; margin: 0 auto 26px; border-radius: 50%; background: var(--grad); position: relative; animation: float 5s ease-in-out infinite; box-shadow: 0 20px 60px -10px var(--violet); }
.status-orb span { position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }

/* ---------- Палитра поиска ---------- */
.cmdk { position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 10, .55); backdrop-filter: blur(6px); animation: fade .2s; }
.cmdk-dialog { position: relative; width: min(620px, 100%); border-radius: 20px; background: var(--solid); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .7); overflow: hidden; animation: pop .25s var(--ease); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.cmdk-input svg { color: var(--muted); }
.cmdk-input input { flex: 1; height: 60px; border: 0; background: none; color: var(--text); font: 500 17px var(--font); outline: none; }
.cmdk-input input::-webkit-search-cancel-button { display: none; }
.cmdk-results { max-height: min(420px, 55vh); overflow-y: auto; padding: 8px; }
.cmdk-results .hint { padding: 26px; text-align: center; color: var(--muted); margin: 0; }
.cmdk-item { display: flex; gap: 14px; align-items: center; padding: 11px 12px; border-radius: 12px; }
.cmdk-item.sel { background: var(--surface-2); }
.cmdk-item .type { font: 500 11px var(--mono); padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none; width: 82px; text-align: center; }
.cmdk-item strong { display: block; font-size: 15px; }
.cmdk-item span.sub { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.cmdk-item mark { background: none; color: var(--accent); }
.cmdk-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cmdk-foot kbd { margin-right: 3px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 95; padding: 12px 20px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; pointer-events: none; transition: all .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Появление при прокрутке */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 50px; }
  .hero-visual { max-width: 560px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .articles { grid-template-columns: 1fr; }
  .article-card.is-lead { grid-row: auto; }
  .about { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-in { height: 64px; gap: 12px; }
  .menu-btn { display: inline-flex; }
  .search-open kbd { display: none; }
  .nav { position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .35s var(--ease); z-index: -1; }
  .nav.open { transform: none; }
  .nav a { padding: 12px 14px; font-size: 17px; }
  .top-actions { margin-left: auto; }
  .projects, .programs { grid-template-columns: 1fr; }
  .article-card { grid-template-columns: 96px 1fr; }
  .article-card .article-cover { height: 84px; }
  .row-card { grid-template-columns: 1fr; gap: 14px; }
  .row-card .row-cover { height: 160px; }
  .stats { gap: 28px; }
  .footer-in { grid-template-columns: 1fr; }
  .prose { font-size: 17px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: auto; }
  .cmdk-foot { display: none; }
  .term-body { font-size: 12.5px; min-height: 0; }
  .orbit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ================= Админка ================= */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 22px 16px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.side .brand { margin: 0 8px 28px; }
.side-label { font: 500 11px var(--mono); letter-spacing: .14em; color: var(--faint); text-transform: uppercase; margin: 10px 10px 8px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 15px; border: 0; background: none; text-align: left; width: 100%; }
.side-link:hover { color: var(--text); background: var(--surface); }
.side-link.active { color: var(--text); background: var(--surface-2); }
.side-link .count { margin-left: auto; font: 12px var(--mono); color: var(--faint); }
.side-bottom { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-main { padding: 30px clamp(18px, 4vw, 48px) 60px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.admin-top h1 { font: 700 28px var(--display); letter-spacing: -.02em; margin: 0; }
.panel { display: none; }
.panel.active { display: block; animation: fade .25s; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.card { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.card span { color: var(--muted); font-size: 13px; font-weight: 600; }
.card strong { display: block; font: 700 30px/1.2 var(--display); margin: 6px 0 2px; letter-spacing: -.02em; }
.card small { color: var(--faint); }
.box { padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 20px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.box-head h2 { font: 700 19px var(--display); margin: 0; letter-spacing: -.015em; }
.chart { display: flex; align-items: end; gap: 6px; height: 140px; padding-top: 10px; }
.chart div { flex: 1; min-width: 6px; border-radius: 6px 6px 2px 2px; background: var(--grad); opacity: .85; position: relative; min-height: 3px; transition: opacity .2s; }
.chart div:hover { opacity: 1; }
.chart div:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; font: 12px var(--mono); background: var(--text); color: var(--bg); padding: 3px 8px; border-radius: 6px; }
.chart-legend { display: flex; justify-content: space-between; color: var(--faint); font: 11px var(--mono); margin-top: 8px; }
.form { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 500; color: var(--faint); }
.input, .field input:not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 500 15px var(--font); transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field input[type=file] { padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--muted); }
.check { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.item-thumb { width: 56px; height: 40px; border-radius: 9px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; font: 700 14px var(--display); color: var(--muted); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-main { min-width: 0; flex: 1; }
.item-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item form { margin: 0; }
.tag-state { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag-state.on { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.editor { border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.editor:focus-within { border-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.toolbar button { min-width: 36px; height: 34px; padding: 0 9px; border-radius: 8px; border: 0; background: none; font-weight: 700; font-size: 14px; color: var(--muted); }
.toolbar button:hover { background: var(--surface-2); color: var(--text); }
.toolbar .sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rich { min-height: 360px; padding: 20px 22px; outline: none; font-size: 17px; line-height: 1.75; }
.rich:empty::before { content: attr(data-placeholder); color: var(--faint); }
.editor-foot { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.cover-preview { width: 100%; max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.login-card { width: min(420px, 100%); padding: 34px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 16px; }
.login-card h1 { font: 700 26px var(--display); margin: 0; letter-spacing: -.02em; }
.login-card p { margin: 0; }
.login-card .brand { margin-bottom: 10px; }
.admin-mobile-bar { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 270px; transform: translateX(-100%); transition: transform .3s var(--ease); background: var(--bg); }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .admin-mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
}
