/* Goldberry — стили блога. Токены (цвета, шрифты, размеры) — в ../css/tokens.css.
   Лёгкие страницы: без интро, без canvas, без JS. */

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.65 var(--f-sans);
  overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }
::selection { background: rgba(201, 162, 94, .35); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  font: 500 var(--fs-label)/1.4 var(--f-mono); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: 0 22px; border-radius: 999px; text-decoration: none;
  font: 500 .9rem/1 var(--f-sans); white-space: nowrap;
  transition: filter .3s, border-color .3s, transform .3s var(--ease);
}
.btn-gold { background: var(--gold-grad); color: var(--on-gold); box-shadow: inset 0 0 0 1px rgba(243, 226, 179, .35); }
.btn-gold:hover { filter: brightness(1.07); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); }

/* ---------- Шапка ---------- */
.b-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 10, 8, .9); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.b-header-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { width: 34px; height: 34px; }
.brand-word {
  font: 500 .78rem/1 var(--f-serif); letter-spacing: .32em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.b-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.b-nav a:not(.btn) {
  font-size: .875rem; color: var(--muted); text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 8px; transition: color .3s, text-decoration-color .3s; padding: 6px 0;
}
.b-nav a:not(.btn):hover, .b-nav a[aria-current="page"] { color: var(--text); text-decoration-color: var(--berry); }
@media (max-width: 560px) {
  .brand-word { display: none; }
  .b-nav { gap: 14px; }
  .b-nav .btn { padding: 0 16px; min-height: 44px; }
  .b-nav .hide-sm { display: none; }
}

/* ---------- Хлебные крошки ---------- */
.crumbs { padding-top: clamp(24px, 4vw, 44px); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.crumbs li { display: flex; align-items: center; gap: 10px; font: 400 .72rem/1.5 var(--f-mono); letter-spacing: .04em; color: var(--muted); }
.crumbs li + li::before { content: "/"; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.crumbs a:hover { color: var(--gold); border-color: var(--gold); }
.crumbs [aria-current="page"] { color: var(--text); overflow-wrap: anywhere; }

/* ---------- Оглавление блога (index) ---------- */
.b-hero { padding-block: clamp(32px, 6vw, 72px) clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.b-hero .label { color: var(--gold); display: flex; align-items: center; gap: 14px; }
.b-hero .label::before { content: ""; width: 36px; height: 1px; background: var(--gold); }
.b-hero h1 { font: 400 var(--fs-display)/1.02 var(--f-serif); letter-spacing: -.01em; margin-top: 18px; }
.b-hero h1 em { font-style: italic; color: var(--gold); }
.b-hero p { color: var(--muted); font-size: var(--fs-lead); max-width: 40em; margin-top: 18px; line-height: 1.55; }

.toc-list { list-style: none; padding: 0; margin: 0 0 clamp(56px, 8vw, 112px); }
.toc-item { border-bottom: 1px solid var(--line); }
.toc-link {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 200px; gap: clamp(16px, 3vw, 40px);
  align-items: start; padding: clamp(24px, 3.5vw, 40px) 0; text-decoration: none; color: inherit;
}
.toc-no { font: 400 clamp(2.4rem, 1.6rem + 2.4vw, 3.6rem)/1 var(--f-serif); color: var(--faint); transition: color .3s; }
.toc-tag { color: var(--gold); }
.toc-title { font: 400 var(--fs-h3)/1.15 var(--f-serif); margin-top: 10px; transition: color .3s; }
.toc-stand { color: var(--muted); margin-top: 12px; max-width: 46em; }
.toc-meta { display: block; margin-top: 14px; font: 400 .72rem/1.5 var(--f-mono); color: var(--muted); letter-spacing: .04em; }
.toc-cover { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.toc-cover svg { width: 100%; height: auto; }
.toc-link:hover .toc-no, .toc-link:focus-visible .toc-no { color: var(--gold); }
.toc-link:hover .toc-title { color: #E2C68E; }
@media (max-width: 860px) {
  .toc-link { grid-template-columns: 56px minmax(0, 1fr); }
  .toc-cover { display: none; }
}
@media (max-width: 420px) {
  .toc-link { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc-no { font-size: 1.6rem; }
}
.b-note { color: var(--muted); font-size: var(--fs-small); max-width: 46em; margin-bottom: 64px; }

/* ---------- Статья ---------- */
.a-head { padding-top: clamp(20px, 3vw, 36px); }
.a-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: clamp(24px, 5vw, 72px); align-items: end; }
.a-tag { color: var(--gold); display: flex; align-items: center; gap: 14px; }
.a-tag::before { content: ""; width: 36px; height: 1px; background: var(--gold); }
.a-head h1 { font: 400 clamp(2.1rem, 1.3rem + 3vw, 3.9rem)/1.05 var(--f-serif); letter-spacing: -.01em; margin-top: 18px; overflow-wrap: break-word; hyphens: auto; }
.a-stand { font: 400 var(--fs-lead)/1.55 var(--f-serif); font-style: italic; color: rgba(239, 230, 216, .82); margin-top: 22px; max-width: 36em; }
.a-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 24px; font: 400 .74rem/1.5 var(--f-mono); color: var(--muted); letter-spacing: .04em; }
.a-meta span + span::before { content: "·"; margin-right: 18px; color: var(--faint); }
.a-cover { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.a-cover svg { width: 100%; height: auto; }
@media (max-width: 860px) {
  .a-head-grid { grid-template-columns: minmax(0, 1fr); }
  .a-cover { max-width: 520px; }
}

.a-body { padding-block: clamp(36px, 5vw, 64px) clamp(48px, 6vw, 80px); }
.prose { max-width: 68ch; margin-inline: auto; font-size: clamp(1.02rem, .98rem + .2vw, 1.125rem); line-height: 1.75; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font: 400 clamp(1.5rem, 1.25rem + 1vw, 2.05rem)/1.2 var(--f-serif); margin-top: 2.1em; scroll-margin-top: 90px; }
.prose h2 + * { margin-top: .8em; }
.prose a { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: #E2C68E; text-decoration-color: var(--berry); }
.prose ul { padding-left: 1.2em; }
.prose ul li + li { margin-top: .45em; }
.prose ul li::marker { color: var(--gold); }
.prose strong { font-weight: 600; color: #F5EDE1; }
.prose sup a { text-decoration: none; font: 500 .7em/1 var(--f-mono); padding: 0 .1em; }
.prose blockquote { margin: 1.4em 0; padding-left: 1.2em; border-left: 2px solid var(--gold); font-family: var(--f-serif); font-style: italic; color: rgba(239, 230, 216, .85); }

.brief {
  margin: 0 0 2em; padding: clamp(20px, 3vw, 30px); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--glow);
}
.brief .label { color: var(--gold); display: block; margin-bottom: 14px; }
.brief ul { list-style: none; padding: 0; counter-reset: b; }
.brief li { counter-increment: b; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 4px; font-size: .98rem; line-height: 1.6; }
.brief li + li { margin-top: .7em; }
.brief li::before { content: counter(b, decimal-leading-zero); font: 400 .72rem/1.9 var(--f-mono); color: var(--gold); }

.caution {
  padding: clamp(20px, 3vw, 28px); border-radius: var(--radius-sm);
  background: rgba(142, 47, 69, .12); border: 1px solid rgba(142, 47, 69, .45);
}
.caution h2 { margin-top: 0 !important; }
.prose .caution { margin-top: 2.2em; }
.caution ul { margin-top: .9em; }
.caution li::marker { color: #C2667B; }

.service {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 18px 20px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); font-size: .95rem;
}
.service p { flex: 1 1 260px; color: var(--muted); }
.prose .service a.btn { color: var(--text); text-decoration: none; }
.prose .service a.btn-gold { color: var(--on-gold); }

.disclaimer { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.2em; margin-top: 2.4em !important; line-height: 1.6; }

.refs { max-width: 68ch; margin: 0 auto; padding-top: 2.2em; border-top: 1px solid var(--line); }
.refs h2 { font: 400 1.35rem/1.2 var(--f-serif); }
.refs ol { padding-left: 1.6em; margin-top: 1em; font-size: .86rem; line-height: 1.6; color: var(--muted); }
.refs li { padding-left: .3em; overflow-wrap: anywhere; }
.refs li + li { margin-top: .7em; }
.refs li::marker { font: 400 .72rem var(--f-mono); color: var(--gold); }
.refs li:target { color: var(--text); }
.refs a { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.refs .ev { display: block; font: 400 .7rem/1.5 var(--f-mono); letter-spacing: .03em; color: var(--faint); margin-top: 2px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 68ch; margin: clamp(40px, 5vw, 64px) auto 0; }
.pager a {
  display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; transition: border-color .3s, background-color .3s;
}
.pager a:hover { border-color: var(--gold); background: var(--surface); }
.pager .label { display: block; margin-bottom: 6px; }
.pager b { font: 400 1.05rem/1.3 var(--f-serif); display: block; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: auto; }
}

/* ---------- Подвал ---------- */
.b-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; background: linear-gradient(var(--bg), #0A0806); }
.b-footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.b-footer p { color: var(--muted); font-size: .9rem; }
.b-footer a { color: var(--muted); }
.b-footer a:hover { color: var(--gold); }
.b-footer .foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; font-size: .9rem; }
.b-footer small { display: block; width: 100%; font: 400 .7rem/1.5 var(--f-mono); color: var(--faint); letter-spacing: .04em; }

/* тап-цели ≥ 44 px (правки 17.11.2026): логотип, пункты меню, ссылки подвала */
.brand { min-height: 44px; }
.b-nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.b-footer a { display: inline-flex; align-items: center; min-height: 44px; }
