:root {
  --bg: #14110f;
  --bg-2: #1d1916;
  --line: #342c26;
  --text: #f3e9dc;
  --muted: #b3a595;
  --faint: #7d7064;
  --chili: #ff5a36;
  --chili-2: #ff8a3d;
  --leaf: #8bc34a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--chili-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0.4em 0 0.3em; }
h2 { font-size: 1.45rem; margin: 0 0 0.6em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Шапка */
.top { border-bottom: 1px solid var(--line); background: rgba(20, 17, 15, 0.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.top-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 22px; font-size: 0.95rem; }
.nav a { color: var(--muted); }
.nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--chili); }
.find { margin-left: auto; }
.find input { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 16px; width: 210px; font: inherit; font-size: 0.9rem; }
.find input:focus { outline: 2px solid var(--chili); outline-offset: 1px; }

/* Первый экран */
.hero { padding: 56px 0 30px; max-width: 760px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.hero h1 em { color: var(--chili); font-style: italic; }
.hero p { color: var(--muted); font-size: 1.1rem; }
.hero.small { padding: 80px 0; }

/* Главная: поиск и вкладки по центру */
.hero-center { margin: 0 auto; text-align: center; max-width: 820px; padding: 44px 0 6px; }
.hero-center p { max-width: 640px; margin: 0 auto; }
.big-find { display: flex; max-width: 620px; margin: 26px auto 0; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.big-find:focus-within { border-color: var(--chili); }
.big-find input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 1.05rem; padding: 14px 22px; outline: none; }
.big-find button { border: 0; background: var(--chili); color: #1a0d08; font: inherit; font-weight: 700; padding: 0 26px; cursor: pointer; }
.big-find button:hover { background: var(--chili-2); }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; }
.tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; color: var(--muted); font-size: 0.92rem; }
.tabs a:hover { border-color: var(--chili); color: var(--text); text-decoration: none; }
.tabs a[aria-current] { background: var(--chili); border-color: var(--chili); color: #1a0d08; font-weight: 700; }

.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 10px 0 40px; align-items: start; }
.group { border: 1px solid var(--line); border-radius: 6px; padding: 18px; background: var(--bg-2); }
.group h2, .group h3 { font-size: 1.05rem; color: var(--muted); font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; color: var(--text); font-size: 0.92rem; }
.chips a:hover { border-color: var(--chili); text-decoration: none; }
.chips span { color: var(--faint); font-size: 0.82rem; margin-left: 3px; }
.chips.small a { font-size: 0.82rem; padding: 3px 10px; }

/* Сетка карточек: фото отдельно, имя и цифры под фото */
.block { margin: 46px 0; }
.hero-center + .block { margin-top: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; }
.card-ph { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--bg-2); }
.card-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .card-ph img { transform: scale(1.03); }
.pill { position: absolute; left: 8px; top: 8px; background: var(--leaf); color: #10200a; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.card-body { padding: 9px 2px 0; }
.card h3 { font-size: 1.08rem; margin: 0; }
.card h3 a { color: var(--text); }
.meta { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; }
.cats { margin: 2px 0 0; color: var(--faint); font-size: 0.8rem; }

/* Списки и категории */
.crumbs { font-size: 0.85rem; color: var(--faint); margin-top: 22px; }
.crumbs a { color: var(--muted); }
.lede { color: var(--muted); font-size: 1.06rem; max-width: 780px; }
.kicker { color: var(--chili); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; margin: 26px 0 0; font-weight: 600; }
.cat-head { margin-bottom: 26px; }
.cat-head h1 { margin-top: 0.2em; }
.facts { color: var(--faint); font-size: 0.9rem; }
.facts strong { color: var(--text); }
.cat-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin: 26px 0; }
.cat-index h2 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cat-index ul { list-style: none; margin: 0; padding: 0; }
.cat-index li { padding: 3px 0; display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); }
.cat-index span { color: var(--faint); font-size: 0.85rem; }
.sorter { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 20px; font-size: 0.9rem; color: var(--faint); }
.sorter a { color: var(--muted); }
.sorter a[aria-current] { color: var(--text); font-weight: 600; }

/* Страница автора */
.creator-top { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 40px; margin-top: 18px; }
.creator-ph { margin: 0; }
.creator-ph img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.creator-info h1 { margin-top: 0; }
.handle { color: var(--faint); margin: -6px 0 14px; }
.lead { font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; margin: 0 0 22px; }
.cta { display: inline-block; background: var(--chili); color: #1a0d08; font-weight: 700; padding: 13px 24px; border-radius: 4px; }
.cta:hover { background: var(--chili-2); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 26px 0 6px; }
.stats div { background: var(--bg-2); padding: 10px 14px; }
.stats dt { color: var(--faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; }
.stats dd { margin: 0; font-size: 1.08rem; font-weight: 600; }
.checked { color: var(--faint); font-size: 0.8rem; margin: 0 0 16px; }
.notes { max-width: 760px; margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.notes p { font-size: 1.04rem; }
.ticks { padding-left: 0; list-style: none; }
.ticks li { padding-left: 24px; position: relative; margin: 6px 0; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 8px; height: 8px; background: var(--chili); transform: rotate(45deg); }

/* Текстовые страницы */
.explain { border-top: 1px solid var(--line); padding-top: 34px; margin: 54px 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.cols h3 { font-size: 1.12rem; margin: 0 0 6px; color: var(--chili-2); }
.cols p { color: var(--muted); margin: 0; }
.prose { max-width: 720px; padding-bottom: 40px; }
.prose h2 { margin-top: 1.6em; }
.prose p { color: #e1d5c6; }

/* Статьи */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px 24px; margin: 10px 0 30px; }
.guide-card svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.guide-card h2, .guide-card h3 { font-size: 1.2rem; margin: 12px 0 6px; }
.guide-card h2 a, .guide-card h3 a { color: var(--text); }
.guide-card p { color: var(--muted); margin: 0; font-size: 0.94rem; }
.guide-head { max-width: 820px; }
.guide-head h1 { margin-top: 0.2em; }
.guide > svg.cover { width: 100%; height: auto; border-radius: 8px; margin: 14px 0 34px; max-height: 460px; }
.guide-cols { display: grid; grid-template-columns: 230px minmax(0, 740px); gap: 48px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 0.9rem; border-left: 2px solid var(--line); padding-left: 16px; }
.toc p { margin: 0 0 8px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; }
.toc ol { margin: 0; padding-left: 18px; color: var(--faint); }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); }
.guide-body { font-size: 1.05rem; }
.guide-body p, .guide-body li { color: #e1d5c6; }
.guide-body h2 { margin-top: 1.8em; scroll-margin-top: 84px; }
.guide-body h3 { font-size: 1.15rem; margin: 1.4em 0 0.4em; }
.guide-body code { background: var(--bg-2); padding: 1px 6px; border-radius: 3px; font-size: 0.9em; }
.short { border: 1px solid var(--chili); border-radius: 6px; padding: 16px 20px 6px; background: linear-gradient(135deg, rgba(255, 90, 54, 0.1), rgba(255, 138, 61, 0.03)); margin-bottom: 26px; }
.short-h { margin: 0; color: var(--chili-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.short ul { padding-left: 20px; }
.note { border-left: 4px solid var(--leaf); background: var(--bg-2); padding: 12px 18px; border-radius: 0 6px 6px 0; }
.warn { border-left: 4px solid var(--chili); background: var(--bg-2); padding: 12px 18px; border-radius: 0 6px 6px 0; }
.guide-body table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 0.95rem; }
.guide-body th, .guide-body td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-body th { color: var(--faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--bg-2); }
.steps { counter-reset: st; list-style: none; padding: 0; }
.steps li { counter-increment: st; position: relative; padding: 2px 0 10px 46px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--chili); color: #1a0d08; font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.bars { margin: 22px 0 28px; padding: 18px 20px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.bars figcaption { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 12px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; margin: 7px 0; font-size: 0.9rem; }
.bar-l { color: var(--muted); }
.bar-t { background: #2a231e; border-radius: 3px; height: 16px; overflow: hidden; }
.bar-t i { display: block; height: 100%; background: linear-gradient(90deg, var(--chili), var(--chili-2)); border-radius: 3px; min-width: 2px; }
.bar-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-src { color: var(--faint); font-size: 0.78rem; margin: 10px 0 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq details p { margin: 8px 0 0; }

/* Подвал */
.foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 36px 0 30px; background: #100d0b; font-size: 0.9rem; }
.foot-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 26px; }
.foot h2 { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 3px 0; }
.foot li a { color: var(--muted); }
.foot-legal { border-top: 1px solid var(--line); padding-top: 20px; color: var(--faint); }
.foot-legal strong { color: var(--chili); }
.foot-legal a { color: var(--muted); }
.copy { margin-bottom: 0; }

@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 10px 18px; }
  .find { margin-left: 0; width: 100%; }
  .find input { width: 100%; }
  .creator-top { grid-template-columns: 1fr; gap: 20px; }
  .creator-ph { max-width: 420px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .guide-cols { grid-template-columns: 1fr; gap: 10px; }
  .toc { position: static; }
  .bar-row { grid-template-columns: 110px 1fr 70px; gap: 8px; font-size: 0.82rem; }
}

/* Языки */
.lang-switch { position: relative; font-size: 0.85rem; }
.lang-switch.push { margin-left: auto; }
.lang-switch summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); letter-spacing: 0.05em; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch[open] summary, .lang-switch summary:hover { border-color: var(--chili); color: var(--text); }
.lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: grid; grid-template-columns: repeat(3, max-content); gap: 2px 14px; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.lang-menu a, .foot-langs a { color: var(--muted); padding: 3px 4px; white-space: nowrap; }
.lang-menu a[aria-current], .foot-langs a[aria-current] { color: var(--text); font-weight: 600; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 18px; font-size: 0.85rem; }
@media (max-width: 760px) {
  .lang-switch { margin-left: auto; }
  .lang-menu { grid-template-columns: repeat(2, max-content); }
}
