@font-face { font-family: 'Onest'; src: url('/fonts/onest-cyrillic.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; src: url('/fonts/onest-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2190-2199; }
@font-face { font-family: 'Oswald'; src: url('/fonts/oswald-cyrillic.woff2') format('woff2'); font-weight: 200 700; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Oswald'; src: url('/fonts/oswald-latin.woff2') format('woff2'); font-weight: 200 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f4f5f7;
  --muted: #b3bac4;
  --accent: #f2b632;
  --accent-ink: #1a1306;
  --link: #8cc6f5;
  --good: #6fcf7f;
  --bad: #ff7a70;
  --warn: #f2c94c;
  --display: 'Oswald', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 10px;
  --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #b9dcfa; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.2; letter-spacing: 0.01em; margin: 1.4em 0 0.5em; }
h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); margin-top: 0.4em; }
h2 { font-size: clamp(1.35rem, 4.5vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p, ul, ol { margin: 0 0 1em; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.92em; }
pre { background: var(--surface-2); padding: 12px; border-radius: var(--r); overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(11, 13, 16, 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { font: 700 1.25rem/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: 0.04em; text-transform: uppercase; margin-right: auto; }
.brand span { color: var(--accent); }
.nav-toggle { display: inline-flex; }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 56px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 10px 4px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-nav a[aria-current='page'] { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; font-weight: 700; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; padding: 0; border: 0; background: none; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { border: 0; padding: 6px 10px; border-radius: 6px; font-size: 0.95rem; }
  .site-nav a:hover { background: var(--surface-2); }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--text); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc94d; color: var(--accent-ink); }
.btn-danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1em 0; }

main { padding-bottom: 48px; }
.hero { position: relative; min-height: 64vh; display: flex; align-items: flex-end; background: #111 center / cover no-repeat; border-bottom: 1px solid var(--line); }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 13, 16, 0.2) 0%, rgba(11, 13, 16, 0.65) 55%, var(--bg) 100%); }
.hero .wrap { position: relative; padding-top: 80px; padding-bottom: 28px; }
.hero p.lead { font-size: 1.15rem; max-width: 640px; color: #e6e8eb; }
.caption { font-size: 0.8rem; color: var(--muted); }
.hero .caption { position: absolute; right: var(--gutter); top: 10px; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h2, .card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
a.card { display: block; color: var(--text); text-decoration: none; }
a.card:hover { border-color: var(--line-strong); }
.shot figure { margin: 0; }
.shot img { border-radius: var(--r); border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.shot figcaption { margin-top: 6px; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 48px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 1rem/34px var(--display); text-align: center; }

.notice { border: 1px solid var(--line-strong); border-left: 4px solid var(--link); background: var(--surface); padding: 12px 14px; border-radius: var(--r); margin: 16px 0; }
.notice > :last-child { margin-bottom: 0; }
.notice-warn { border-left-color: var(--warn); }
.notice-bad { border-left-color: var(--bad); }
.notice-good { border-left-color: var(--good); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.8rem; line-height: 1.5; white-space: nowrap; }
.tag-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag-good { border-color: var(--good); color: var(--good); }
.tag-bad { border-color: var(--bad); color: var(--bad); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

form { margin: 0; }
.field { margin: 0 0 18px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; color: var(--muted); font-size: 0.875rem; margin: -2px 0 6px; }
.field .error { display: block; color: var(--bad); font-size: 0.9rem; margin-top: 6px; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 18px; }
input[type='text'], input[type='number'], input[type='datetime-local'], input[type='url'], input[type='search'], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #0f1216; color: var(--text); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(242, 182, 50, 0.3); }
[aria-invalid='true'] { border-color: var(--bad) !important; }
input[type='file'] { width: 100%; padding: 10px 0; color: var(--muted); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-weight: 400 !important; }
.choice input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error-summary { border: 2px solid var(--bad); border-radius: var(--r); padding: 12px 16px; margin: 0 0 20px; background: rgba(255, 122, 112, 0.08); }
.error-summary h2 { margin: 0 0 6px; font-size: 1.1rem; }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--bad); }
.draft-status { font-size: 0.85rem; color: var(--muted); min-height: 1.4em; }

.table-wrap { overflow-x: auto; margin: 0 0 1em; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); }

.list { list-style: none; padding: 0; margin: 0; }
.list > li { border-bottom: 1px solid var(--line); padding: 12px 0; }
.list > li:last-child { border-bottom: 0; }
.row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.row .grow { flex: 1 1 200px; }

.thread { list-style: none; padding: 0; margin: 0 0 20px; }
.thread li { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); white-space: pre-wrap; word-break: break-word; }
.thread li.staff { border-left: 4px solid var(--link); }
.thread li.internal { border-left: 4px solid var(--warn); background: #1c1a12; }
.thread li.counterparty { border-left: 4px solid #c48cf5; }
.thread li.system { background: transparent; border-style: dashed; }
.thread .meta { display: block; white-space: normal; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
dl.props { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 12px; margin: 0 0 1em; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; word-break: break-word; white-space: pre-wrap; }

.rules section { margin-bottom: 26px; }
.rule { border-top: 1px solid var(--line); padding: 12px 0; }
.rule h3 { margin: 0 0 4px; font-size: 1.05rem; }
.rule .code { color: var(--accent); font-family: var(--display); margin-right: 6px; }

.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 16px; }
.filters .field { margin: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 0.9rem; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.breadcrumbs { font-size: 0.875rem; color: var(--muted); margin-top: 16px; }
.toc { font-size: 0.95rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
