/* Справочный центр Projio: бумага сайта projio.ru, оранжевый бренда — только для акцентов. */
:root {
  --paper: #fffaf6;
  --surface: #ffffff;
  --ink: #292929;
  --muted: #5b5b5b;
  --line: #e6dfd8;
  --accent: #c97a0c;
  --accent-bg: #fdf0dc;
  --brand: #f8a228;
  --code: #f4ede6;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --surface: #201d19;
    --ink: #ece7e1;
    --muted: #a69e95;
    --line: #34302a;
    --accent: #f5b04a;
    --accent-bg: #3a2c16;
    --code: #2a2621;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }

/* Шапка */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 700; }
.search { position: relative; }
.search--top { margin-left: auto; width: min(420px, 100%); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 13px 50% no-repeat; color: var(--ink); font: inherit; }
.search--hero input { height: 56px; font-size: 18px; border-radius: 14px; padding-left: 46px; background-position: 17px 50%; box-shadow: 0 6px 24px rgb(0 0 0 / 6%); }
.search__drop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 12%); overflow: hidden; text-align: left; }
.search__drop a { display: block; padding: 10px 14px; color: var(--ink); border-top: 1px solid var(--line); }
.search__drop a:first-child { border-top: 0; }
.search__drop a:hover, .search__drop a.is-active { background: var(--accent-bg); text-decoration: none; }
.search__drop small { display: block; color: var(--muted); font-size: 13px; }
.search__drop .search__all { color: var(--accent); font-weight: 500; }

/* Главная */
.hero { padding-block: 56px 40px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 10px; text-wrap: balance; }
.hero p { margin: 0 auto 28px; color: var(--muted); max-width: 60ch; }
.hero .search { max-width: 680px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.card__head { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.card__head:hover { text-decoration: none; color: var(--accent); }
.card__head h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.card__icon, .title__icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--accent-bg); color: var(--accent); }
.card__text { margin: 0; color: var(--muted); font-size: 15px; }
.card__list { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; }
.card__list a { color: var(--ink); }
.card__list a:hover { color: var(--accent); }
.card__more { margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 500; }

/* Раздел и статья */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 28px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs__sep { opacity: .5; }
.title { display: flex; align-items: center; gap: 14px; font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 14px 0 8px; text-wrap: balance; }
.meta { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.lead { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 24px 0 64px; border-top: 1px solid var(--line); }
.list a { display: grid; gap: 2px; padding: 16px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list a:hover { text-decoration: none; background: var(--accent-bg); }
.list strong { font-weight: 600; }
.list span { color: var(--muted); font-size: 15px; }

.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding-bottom: 72px; }
.side { position: sticky; top: 84px; align-self: start; padding-top: 32px; max-height: calc(100vh - 100px); overflow: auto; }
.side__title { display: block; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.side ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.side li a { display: block; padding: 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: 15px; line-height: 1.35; }
.side li a:hover { color: var(--ink); text-decoration: none; }
.side li a[aria-current] { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.doc { min-width: 0; max-width: 760px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0 0 24px; font-size: 15px; }
.toc ul { margin: 6px 0 0; padding-left: 18px; }

.prose h2 { font-size: 23px; line-height: 1.3; margin: 36px 0 10px; scroll-margin-top: 80px; }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li + li { margin-top: 4px; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--code); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: var(--code); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; background: var(--surface); }
.prose blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.admonition { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; background: var(--accent-bg); border-left: 4px solid var(--brand); }
.admonition.warning { background: color-mix(in srgb, #c0392b 10%, var(--surface)); border-left-color: #c0392b; }
.admonition-title { font-weight: 600; margin: 0 0 4px !important; }
.admonition p:last-child { margin-bottom: 0; }
kbd { font-family: var(--mono); font-size: .85em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* Скриншоты приложения: телефонный экран в рамке, по нажатию — крупно. */
.shot { margin: 8px 0 24px; display: grid; gap: 8px; justify-items: center; }
.shot__row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; max-width: 100%; }
.shot img { width: 240px; max-width: 100%; height: auto; border-radius: 22px; border: 6px solid #1d1a17; box-shadow: 0 10px 30px rgb(0 0 0 / 18%); cursor: zoom-in; background: #15120f; }
.shot--1 img { width: 280px; }
.shot figcaption { color: var(--muted); font-size: 14px; text-align: center; max-width: 60ch; }
@media (max-width: 520px) { .shot--2 img, .shot--3 img { width: calc(50% - 8px); } }
.zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(10 9 8 / 88%); cursor: zoom-out; }
.zoom img { max-height: calc(100vh - 32px); max-width: 100%; border-radius: 18px; }
.zoom__close { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff2; color: #fff; font-size: 26px; cursor: pointer; }

/* Главная: кому что читать и частые вопросы. */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.roles a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.roles a:hover { border-color: var(--accent); text-decoration: none; }
.roles b { font-size: 16px; }
.roles span { color: var(--muted); font-size: 14px; }
.popular { margin: 0 0 32px; }
.popular h2, .roles-title { font-size: 20px; margin: 0 0 12px; }
.popular ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 24px; }
.popular a { display: block; padding: 6px 0; color: var(--ink); border-bottom: 1px dashed var(--line); }
.popular a:hover { color: var(--accent); text-decoration: none; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { color: var(--muted); }
.pager__next { grid-column: 2; text-align: right; }

.results { margin-bottom: 64px; }
.results a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.results a:hover { background: var(--accent-bg); text-decoration: none; }
.results small { display: block; color: var(--muted); }
.results mark { background: var(--accent-bg); color: inherit; border-radius: 3px; }
.empty { padding-bottom: 96px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 22px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; max-height: none; padding-top: 0; order: 2; margin-top: 40px; }
  .brand span:last-child { display: none; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager__next { grid-column: 1; }
  .hero { padding-top: 36px; }
}
