/* Дошло — справочник доставки почты с VPS. Borisoff, 2026 */
:root {
  --paper: #f3eee4;
  --paper-2: #e8e0d1;
  --ink: #171410;
  --muted: #5b5448;
  --rule: #c9bba4;
  --stamp: #9c1c1c;
  --stamp-deep: #6e1010;
  --ok: #1f4f36;
  --ok-bg: #e4efe6;
  --warn-bg: #f4e6d4;
  --code-bg: #1c1a16;
  --code-fg: #efe6d6;
  --code-muted: #b3a894;
  --max: 44rem;
  --wide: 68rem;
  --shadow: 0 1px 0 rgba(23, 20, 16, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--stamp); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--stamp-deep); }
a:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; }

code, kbd, pre, .mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Liberation Mono", Menlo, Consolas, monospace;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: #fff;
  padding: 0.4rem 0.7rem;
  color: var(--ink);
}

.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.narrow { width: min(100%, var(--max)); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 3rem;
  height: 3rem;
  flex: none;
}
.brand-name {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  line-height: 1.1;
}
.brand-tag {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--stamp);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Hero / page */
.hero {
  padding: 2.4rem 0 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
  margin: 0 0 0.6rem;
}
.hero h1, .article h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  line-height: 1.15;
  margin: 0 0 0.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 40rem;
  margin: 0 0 1.2rem;
}
.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.card {
  background: #fffdf8;
  border: 1px solid var(--rule);
  padding: 1.15rem 1.2rem 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 10rem;
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--stamp); }
.card h2 {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .more { margin-top: auto; color: var(--stamp); font-size: 0.9rem; }

/* Sections */
section { padding: 2rem 0; }
section + section { border-top: 1px solid var(--rule); }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 0.8rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin: 0 0 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; }

.checklist {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.checklist li {
  counter-increment: step;
  position: relative;
  padding: 0.85rem 0 0.85rem 3.1rem;
  border-top: 1px solid var(--rule);
}
.checklist li:last-child { border-bottom: 1px solid var(--rule); }
.checklist li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.9rem;
  color: var(--stamp);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.callout {
  background: var(--ok-bg);
  border-left: 3px solid var(--ok);
  padding: 0.9rem 1rem;
  margin: 0 0 1.2rem;
}
.callout.warn {
  background: var(--warn-bg);
  border-left-color: var(--stamp);
}
.callout p:last-child { margin-bottom: 0; }

/* Code */
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0 0 1.2rem;
  border-radius: 2px;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
code {
  background: var(--paper-2);
  padding: 0.08em 0.35em;
  font-size: 0.86em;
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 0 1.3rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
th { font-weight: 700; }

.sources {
  font-size: 0.95rem;
}
.sources h2 { font-size: 1.15rem; }
.article { padding: 2rem 0 3rem; }
.article .narrow p, .article .narrow li { max-width: 42rem; }

.toc {
  background: #fffdf8;
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
}
.toc strong { display: block; margin-bottom: 0.4rem; }
.toc ol { margin: 0; }

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.4rem;
}

footer.site-footer {
  border-top: 2px solid var(--ink);
  padding: 1.6rem 0 2.2rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
}
footer a { color: var(--ink); }
.footer-name { color: var(--ink); font-weight: 700; letter-spacing: 0.04em; }

@media (max-width: 700px) {
  body { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-tag { max-width: 14rem; }
  th, td { padding-right: 0.4rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .nav { display: none; }
  body { background: #fff; }
  a { color: inherit; text-decoration: none; }
}
