/* ============================================================
   Заметки — стили блога. Один файл, без зависимостей.
   Палитра и типографика меняются в блоке :root ниже.
   ============================================================ */

:root {
  --bg:        #fcfbf8;
  --bg-soft:   #f4f2ed;
  --fg:        #16181d;
  --fg-muted:  #6b6f76;
  --line:      #e4e0d8;
  --accent:    #1f5eff;
  --accent-soft: #eaf0ff;
  --radius:    14px;
  --maxw:      720px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg:        #101216;
  --bg-soft:   #171a20;
  --fg:        #e8e9ec;
  --fg-muted:  #9aa0aa;
  --line:      #262a32;
  --accent:    #7fa6ff;
  --accent-soft: #1a2233;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- шапка ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
}

.brand {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  margin-right: auto;
}

.brand span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 15px;
  padding: 7px 11px;
  border-radius: 9px;
  transition: background .15s, color .15s;
}

.nav a:hover { color: var(--fg); background: var(--bg-soft); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--bg-soft); }

.theme-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-muted);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s, border-color .15s;
}

.theme-btn:hover { color: var(--fg); background: var(--bg-soft); border-color: var(--fg-muted); }

/* ---------- герой ---------- */

.hero {
  padding: 62px 0 34px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(30px, 6vw, 43px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 600;
}

.hero p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 18px;
  max-width: 52ch;
}

/* ---------- список постов ---------- */

.section-title {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
  margin: 34px 0 6px;
}

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

.post-list li { border-bottom: 1px solid var(--line); }
.post-list li:first-child { border-top: 1px solid var(--line); }

.post-list a {
  display: block;
  padding: 22px 2px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  border-radius: var(--radius);
}

.post-list a:hover { background: var(--bg-soft); }

.post-list h2 {
  font-family: var(--font-head);
  font-size: 23px;
  line-height: 1.3;
  margin: 0 0 7px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.post-list a:hover h2 { color: var(--accent); }

.post-list p {
  margin: 0 0 9px;
  color: var(--fg-muted);
  font-size: 16px;
}

.meta {
  font-size: 13px;
  color: var(--fg-muted);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

/* ---------- статья ---------- */

.article { padding: 46px 0 20px; }

.article header { margin-bottom: 30px; }

.article h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 5.5vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
}

.article-body > * { margin: 0 0 1.15em; }

.article-body h2 {
  font-family: var(--font-head);
  font-size: 26px;
  line-height: 1.3;
  margin: 2em 0 .6em;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.article-body h3 {
  font-size: 19px;
  margin: 1.7em 0 .5em;
  font-weight: 650;
}

.article-body a { color: var(--accent); text-underline-offset: 3px; }

.article-body ul,
.article-body ol { padding-left: 1.35em; }
.article-body li { margin: .35em 0; }

.article-body blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
  font-style: italic;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--bg-soft);
  padding: .16em .42em;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.article-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.55;
}

.article-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

/* ---------- подвал ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  color: var(--fg-muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .spacer { margin-left: auto; }

/* ---------- страница 404 ---------- */

.center-page {
  padding: 96px 0;
  text-align: center;
}

.center-page h1 {
  font-family: var(--font-head);
  font-size: 64px;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

/* ---------- адаптив ---------- */

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .hero { padding: 40px 0 22px; }
  .article { padding: 30px 0 12px; }
  .nav a { padding: 7px 8px; font-size: 14px; }
}
