:root {
  --paper: #ffffff;
  --ink: #161616;
  --muted: #626262;
  --line: #d9d9d9;
  --soft-line: #eeeeee;
  --mm-line: rgba(0, 0, 0, 0.028);
  --accent: #0b5cad;
  --accent-dark: #073f76;
  --max-width: 1040px;
  --text-width: 760px;
  color-scheme: light;
}

@font-face {
  font-family: "Blog GOST";
  src: url("/assets/fonts/gost-b.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Blog GOST", "GOST type A", "GOST 2.304", "Gost UI", "Arial Narrow", Arial, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.58;
}

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

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

.site-header,
.site-footer {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
  border-style: solid;
}

.site-header {
  border-width: 0;
}

.site-footer {
  margin-top: 64px;
  border-width: 1px 0 0;
}

.header-inner,
.footer-inner,
.page-inner {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 76px;
}

.brand {
  display: inline-grid;
  gap: 2px;
  color: var(--ink);
  text-decoration: none;
}

.brand-title {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: flex-end;
}

.nav a {
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
  text-transform: uppercase;
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.page-shell {
  background-image: url("/assets/images/millimeter-grid-40.png");
  background-position: left -1px;
  min-height: calc(100vh - 77px);
  padding: 48px 0 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 40px;
  align-items: end;
  padding-bottom: 36px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  max-width: var(--text-width);
  margin: 0 0 18px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  text-transform: uppercase;
}

h2 {
  margin-top: 44px;
  font-size: 1.72rem;
}

h3 {
  margin-top: 32px;
  font-size: 1.24rem;
}

p,
ul,
ol,
blockquote,
pre,
figure {
  max-width: var(--text-width);
}

p {
  margin: 0 0 18px;
}

ul,
ol {
  margin: 0 0 20px;
  padding-left: 1.3em;
}

li + li {
  margin-top: 6px;
}

.intro-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.04rem;
}

.contact-plate {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 18px;
}

.contact-plate h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  text-transform: uppercase;
}

.contact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-title {
  margin-top: 44px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.24rem;
  text-transform: uppercase;
}

.post-list {
  display: grid;
  gap: 28px;
  margin-top: 24px;
}

.post-preview {
  display: grid;
  gap: 12px;
  max-width: var(--text-width);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.post-preview h2 {
  margin: 0;
  font-size: 1.52rem;
}

.post-preview p {
  margin-bottom: 0;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.read-more {
  width: fit-content;
  font-weight: 700;
  text-transform: uppercase;
}

.content {
  max-width: var(--text-width);
}

.article-header {
  max-width: var(--text-width);
  padding-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}

.article-header h1 {
  margin-bottom: 16px;
}

blockquote {
  margin: 24px 0;
  border-left: 4px solid var(--ink);
  padding: 8px 0 8px 18px;
  color: var(--muted);
}

pre,
code {
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

code {
  border: 0;
  background: transparent;
  padding: 0;
  color: #083f73;
  font-size: 0.82em;
  font-weight: 400;
  line-height: 1;
  vertical-align: baseline;
}

pre {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: #f7f7f7;
  padding: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.lightbox-source {
  cursor: zoom-in;
}

figure {
  margin: 28px 0;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.build-commit {
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(48px, 1fr) minmax(0, auto) minmax(48px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  justify-items: center;
  background: rgba(255, 255, 255, 0.96);
  padding: 24px;
}

.lightbox-figure {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: min(100%, 1180px);
  max-height: 100%;
  margin: 0;
}

.lightbox-image {
  max-width: min(100%, 1180px);
  max-height: calc(100vh - 140px);
  border: 1px solid var(--line);
  background: var(--paper);
  object-fit: contain;
}

.lightbox-caption {
  max-width: min(100%, 900px);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox button {
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.lightbox-close {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: end;
  padding: 10px 14px;
  text-transform: uppercase;
}

.lightbox-nav {
  grid-row: 2;
  align-self: center;
  padding: 14px 16px;
  text-transform: uppercase;
}

.lightbox-prev {
  grid-column: 1;
  justify-self: end;
}

.lightbox-next {
  grid-column: 3;
  justify-self: start;
}

@media (max-width: 760px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 0;
  }

  .nav {
    justify-content: flex-start;
  }

  .page-shell {
    padding-top: 32px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
  }

  .lightbox-close {
    grid-column: 1 / -1;
  }

  .lightbox-figure {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lightbox-image {
    max-height: calc(100vh - 150px);
  }

  .lightbox-nav {
    grid-row: 3;
    width: 100%;
  }

  .lightbox-prev {
    grid-column: 1;
    justify-self: stretch;
  }

  .lightbox-next {
    grid-column: 2;
    justify-self: stretch;
  }
}
