:root {
  --accent: #3978c5;
  --accent-strong: #2f69ad;
  --accent-soft: #eef5fc;
  --ink: #17202a;
  --ink-soft: #4f5e6b;
  --surface: #ffffff;
  --surface-muted: #f6f9fc;
  --border: rgba(23, 32, 42, 0.10);
  --border-strong: rgba(23, 32, 42, 0.18);
  --shadow: 0 12px 40px rgba(31, 49, 67, 0.10);
  --content-width: 820px;
  --site-width: 1180px;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-muted);
  font: 16px/1.65 "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

img {
  vertical-align: middle;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.7em 0 0.55em;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.15rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p,
ul,
ol,
dl,
blockquote,
pre,
table,
figure {
  margin-top: 0;
  margin-bottom: 1.35rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.25rem;
}

hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.95rem 1.15rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

blockquote > :last-child {
  margin-bottom: 0;
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

:not(pre) > code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f2f5f8;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  border-radius: 9px;
  background: #101820;
  color: #f5f7fa;
  line-height: 1.55;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
}

figure {
  margin-left: 0;
  margin-right: 0;
}

figcaption {
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.container {
  width: 100%;
  max-width: var(--site-width);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.container--outer {
  min-height: 100vh;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wrapper {
  min-height: 55vh;
  padding: 2.25rem 2rem 3.5rem;
  background: var(--surface);
}

.primary {
  min-width: 0;
  width: 100%;
}

.flex {
  display: flex;
}

.clearfix::after {
  display: table;
  clear: both;
  content: "";
}

.header {
  background: var(--surface);
}

.header__container {
  padding-top: 1.5rem;
}

.logo {
  padding: 0 0 1.1rem;
}

.logo__link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.logo__link:hover {
  color: var(--ink);
}

.logo__img {
  width: auto;
  max-height: 54px;
}

.logo__title {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.logo__tagline {
  margin-top: 0.38rem;
  padding-top: 0.38rem;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.84rem;
  line-height: 1.25;
}

.menu {
  border-bottom: 3px solid var(--accent);
  background: var(--ink);
}

.menu__btn {
  display: none;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.menu__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ink);
}

.menu__item {
  margin: 0;
}

.menu__link {
  display: block;
  padding: 0.82rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.menu__link:hover,
.menu__item--active .menu__link {
  background: var(--accent);
  color: #fff;
}

.divider {
  height: 3px;
  background: var(--accent);
}

.main {
  width: 100%;
}

.main__content,
.post {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

.page-header,
.main > .post-list {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1,
.post__title {
  margin-top: 0;
}

.post__header {
  margin-bottom: 1.5rem;
}

.post__title {
  margin-bottom: 0.75rem;
}

.post__lead {
  margin: 0 0 1.2rem;
  color: var(--ink-soft);
  font-size: 1.18rem;
  line-height: 1.55;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin: 1.15rem 0 1.5rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.meta,
.meta a {
  color: #697784;
  font-size: 0.87rem;
  text-decoration: none;
}

.meta a:hover {
  color: var(--accent);
}

.meta__item + .meta__item::before {
  margin-right: 0.8rem;
  color: #a2acb5;
  content: "·";
}

.post__thumbnail,
.thumbnail {
  margin: 1.5rem 0 2rem;
}

.thumbnail__image {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.content {
  overflow-wrap: break-word;
}

.content > :first-child {
  margin-top: 0;
}

.content a,
.warning a,
.authorbox__description a {
  text-decoration-color: rgba(57, 120, 197, 0.35);
}

.content a:hover,
.warning a:hover,
.authorbox__description a:hover {
  text-decoration-color: currentColor;
}

.content img {
  border-radius: 6px;
}

.post__footer {
  max-width: var(--content-width);
  margin: 2rem auto 0;
}

.tags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tags__label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags__item {
  margin: 0;
}

.btn,
.tags__link {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover,
.tags__link:hover {
  background: var(--accent);
  color: #fff;
}

.authorbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  max-width: var(--content-width);
  margin: 2.5rem auto 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}

.authorbox__avatar {
  grid-row: 1 / span 2;
  margin: 0;
}

.authorbox__avatar img,
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.authorbox__header {
  align-self: end;
  font-weight: 700;
}

.authorbox__description {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.authorbox__description > :last-child {
  margin-bottom: 0;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: var(--content-width);
  margin: 2rem auto 0;
}

.pager__item--next {
  text-align: right;
}

.pager__link {
  display: block;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.pager__link:hover {
  border-color: rgba(57, 120, 197, 0.32);
  color: var(--accent);
}

.pager__subtitle {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pager__title {
  margin: 0.35rem 0 0;
  font-weight: 700;
  line-height: 1.35;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.footer__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
}

.footer__copyright {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li {
  margin: 0;
}

.footer__links a {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--accent);
}

.term-list,
.post-list {
  padding-left: 0;
  list-style: none;
}

.term-list li,
.post-list > li {
  margin: 0;
}

.warning {
  padding: 0.9rem 1rem;
  border-left: 4px solid #c58a28;
  background: #fff8e8;
}

@media (max-width: 766px) {
  body {
    background: var(--surface);
  }

  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .container--outer {
    box-shadow: none;
  }

  .header__container {
    padding-top: 1rem;
  }

  .wrapper {
    padding: 1.5rem 18px 2.5rem;
  }

  .menu {
    margin-left: -18px;
    margin-right: -18px;
  }

  .menu__btn {
    display: block;
  }

  .menu__list {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s ease;
  }

  .no-js .menu__list,
  .menu__list--active {
    max-height: 40rem;
  }

  .menu__link {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .menu__item + .menu__item {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager__item--next {
    text-align: left;
  }

  .authorbox {
    grid-template-columns: 1fr;
  }

  .authorbox__avatar {
    grid-row: auto;
  }

  .footer__container {
    align-items: flex-start;
    flex-direction: column;
  }
}
