/* matchstickproject.com — одна таблица стилей, без зависимостей */
:root {
  --bg: #fbf8f3;
  --panel: #f4efe6;
  --ink: #2c2622;
  --muted: #6b615a;
  --rule: #ddd2c2;
  --accent: #a8412a;
  --wood: #e6c9a0;
  --measure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1917;
    --panel: #232020;
    --ink: #e8e1d8;
    --muted: #a49a90;
    --rule: #3a3431;
    --accent: #d9744f;
    --wood: #7a5c3a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* --- шапка --- */
header.site { border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem; }
header.site .wrap { padding-top: 2rem; padding-bottom: 1.25rem; }
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; color: inherit; }
.brand svg { flex: 0 0 auto; width: 18px; height: 30px; transform: translateY(4px); }
.brand b { font-size: 1.22rem; letter-spacing: -.01em; }
.tagline { color: var(--muted); font-size: .92rem; margin: .35rem 0 0; font-style: italic; }
nav.site { margin-top: 1.15rem; }
nav.site a {
  color: var(--muted); text-decoration: none; font-size: .93rem;
  margin-right: 1.1rem; border-bottom: 1px solid transparent; padding-bottom: 1px;
}
nav.site a:hover { color: var(--ink); border-bottom-color: var(--accent); }
nav.site a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* --- текст --- */
main .wrap { padding-bottom: 3rem; }
h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 1.1rem; letter-spacing: -.015em; }
h2 { font-size: 1.28rem; margin: 2.4rem 0 .7rem; letter-spacing: -.01em; }
h3 { font-size: 1.06rem; margin: 1.6rem 0 .4rem; }
p, dd { margin: 0 0 1rem; }
.lede { font-size: 1.08rem; color: var(--muted); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* --- таблицы --- */
.tablewrap { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 32rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: normal; }

/* --- карточки на главной --- */
.cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1.8rem 0 .5rem; }
.card {
  display: block; padding: 1rem 1.1rem; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 3px; text-decoration: none; color: inherit;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); }

/* --- диаграммы --- */
figure.diagram { margin: 1.8rem 0; }
figure.diagram svg { width: 100%; height: auto; display: block; }
.dlabel { font: 500 11px/1 system-ui, sans-serif; fill: var(--ink); }
.dsub { font: 400 10px/1 system-ui, sans-serif; fill: var(--muted); }
figcaption { font-size: .87rem; color: var(--muted); margin-top: .6rem; }

/* --- журнал --- */
.entry { padding-bottom: 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry h2 { margin-top: 0; }
.entry .meta { font-size: .84rem; color: var(--muted); margin: -.35rem 0 .8rem; font-style: italic; }

/* --- словарь --- */
dl.glossary dt { font-weight: bold; margin-top: 1.1rem; }
dl.glossary dd { margin-left: 0; color: var(--muted); }

/* --- подвал --- */
footer.site { border-top: 1px solid var(--rule); padding: 1.4rem 0 2.5rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
footer.site p { margin: 0; font-size: .85rem; color: var(--muted); }

@media (max-width: 30rem) {
  body { font-size: 16px; }
  h1 { font-size: 1.55rem; }
  nav.site a { margin-right: .85rem; }
}
