/* Scribe by FTech public pages — minimal, readable, no dependencies */
:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e5e5e5;
  --link: #0b57d0;
  --link-hover: #0842a0;
  --nav-bg: #fff;
  --max: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #ececec;
    --muted: #a3a3a3;
    --border: #2e2e2e;
    --link: #7eb4ff;
    --link-hover: #a8cbff;
    --nav-bg: #1a1a1a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1rem 3rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  margin: 0 -1rem 1.5rem;
  padding: 0.75rem 1rem;
}

.site-nav {
  max-width: calc(var(--max) + 2rem);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
}

.site-nav a.brand {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-nav a.brand:hover {
  color: var(--link);
}

.site-nav .sep {
  color: var(--border);
  user-select: none;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
}

h1 {
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 1.75rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.35rem;
}

p {
  margin: 0 0 0.85rem;
}

ul,
ol {
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.35rem;
}

.meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 0.85rem;
  margin-top: 1.5rem;
}

.site-footer {
  max-width: var(--max);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.lang-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.lang-block h2:first-child {
  margin-top: 0;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-list li {
  margin: 0 0 0.5rem;
}

.card-list a {
  display: block;
  padding: 0.65rem 0.85rem;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}

.card-list a:hover {
  border-color: var(--link);
  color: var(--link);
}

.card-list .sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.allcaps {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Full English + full Russian on the same page */
.lang-switch {
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}
hr.lang-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
section.doc-en > h1:first-child,
section.doc-ru > h1:first-child {
  margin-top: 0;
}
