@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-cyrillic-ext-400-800.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-cyrillic-400-800.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-400-800.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-100-500.woff2') format('woff2');
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-600-900.woff2') format('woff2');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #11121c;
  --muted: #676b80;
  --accent: #3d69e7;
  --accent-dark: #2f55c7;
  --accent-soft: #edf2ff;
  --focus: #3d69e7;
  --paper: #fcfcff;
  --surface: #ffffff;
  --soft: var(--accent-soft);
  --line: #e1e6f0;
  --dark: #191b2a;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --ink: #f2f5fb;
  --muted: #aab4c6;
  --accent: #3d69e7;
  --accent-dark: #2f55c7;
  --accent-soft: #1c2a49;
  --focus: #3d69e7;
  --paper: #10141d;
  --surface: #171d28;
  --soft: #1b2433;
  --line: #2b3546;
  --dark: #090c12;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', Arial, sans-serif;
  font-variant-ligatures: normal;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.shell {
  width: min(1180px, calc(100% - 96px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(237, 242, 255, .96);
  border-bottom: 1px solid #d9e2f5;
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 88px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.brand-light {
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: 25px;
  margin-left: auto;
  color: #424159;
  font-size: 13px;
}

.site-nav a {
  padding: 9px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.theme-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef0f6;
}

.theme-switcher button {
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #73798a;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.theme-switcher button:hover {
  color: var(--ink);
}

.theme-switcher button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 7px rgba(21, 26, 42, .1);
}

.theme-switcher svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-switcher button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.header-cta,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  background-color: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background-color .2s ease;
}

.header-cta:hover,
.primary-button:hover {
  background-color: var(--accent-dark);
}

.eyebrow {
  margin: 0 0 22px;
  color: #3158bd;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
}

.blog-hero {
  padding-top: 108px;
  padding-bottom: 86px;
}

.blog-hero h1,
.article-header h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(44px, 6vw, 82px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -.065em;
}

.blog-lead {
  max-width: 720px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.posts-section {
  padding-bottom: 112px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 29px;
  letter-spacing: -.05em;
}

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

.post-card > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 44px 0 46px;
  border-top: 1px solid transparent;
}

.post-card > a:hover h3 {
  color: var(--accent);
}

.post-meta,
.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
}

.post-card h3 {
  max-width: 850px;
  margin: 13px 0 15px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.25;
  letter-spacing: -.05em;
  transition: color .2s ease;
}

.tag-list,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-list span,
.article-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #575b70;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
}

.post-card-arrow {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.empty-state {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.empty-state p {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.04em;
}

.empty-state span {
  color: var(--muted);
  font-size: 14px;
}

.blog-cta {
  margin: 0 12px 12px;
  padding: 72px 0;
  border-radius: 28px;
  background: var(--dark);
  color: #fff;
}

.blog-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.blog-cta .eyebrow {
  color: #9bb2f0;
}

.blog-cta h2 {
  max-width: 730px;
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.2;
  letter-spacing: -.055em;
}

.blog-cta .primary-button {
  flex-shrink: 0;
}

.site-footer {
  padding: 34px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.footer-brand {
  font-size: 16px;
}

.footer-inner p,
.footer-inner > span {
  margin: 0;
  color: #777e91;
  font-size: 11px;
}

.footer-inner > span {
  margin-left: auto;
}

.article-page {
  padding-top: 76px;
}

.back-link {
  display: inline-block;
  margin-bottom: 54px;
  color: var(--muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
}

.back-link:hover {
  color: var(--accent);
}

.article-tags {
  margin: 0 0 27px;
}

.article-header h1 {
  max-width: 1080px;
  font-size: clamp(39px, 5.2vw, 70px);
}

.article-byline {
  margin-top: 34px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.article-grid {
  padding-top: 72px;
}

.article-content {
  max-width: 820px;
  margin-inline: auto;
  min-width: 0;
  color: #292b38;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.85;
}

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

.article-content p {
  margin: 0 0 1.45em;
}

.article-content h2,
.article-content h3 {
  color: var(--ink);
  font-family: 'Manrope', Arial, sans-serif;
  letter-spacing: -.045em;
}

.article-content h2 {
  margin: 2.2em 0 .8em;
  font-size: 31px;
  line-height: 1.3;
}

.article-content h3 {
  margin: 2em 0 .7em;
  font-size: 22px;
  line-height: 1.35;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.4em;
}

.article-content li {
  margin: .5em 0;
  padding-left: .3em;
}

.article-content li::marker {
  color: var(--accent);
}

.article-content strong {
  color: var(--ink);
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-content blockquote {
  margin: 2em 0;
  padding: 8px 0 8px 24px;
  border-left: 3px solid var(--accent);
  color: #4f5366;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: .86em;
}

.article-content img {
  margin: 2.2em 0;
  border-radius: 18px;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-top: 80px;
  margin-bottom: 88px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.article-footer p {
  max-width: 670px;
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.045em;
}

.article-footer .primary-button {
  flex-shrink: 0;
}

@media (max-width: 850px) {
  .shell {
    width: calc(100% - 48px);
  }

  .header-inner {
    min-height: 76px;
    gap: 20px;
  }

  .site-nav a:not([aria-current='page']) {
    display: none;
  }

  .site-nav {
    margin-left: auto;
  }

}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 40px);
  }

  .header-inner {
    min-height: 70px;
    gap: 12px;
  }

  .brand {
    gap: 7px;
    font-size: 16px;
  }

  .brand img {
    width: 35px;
    height: 35px;
  }

  .brand-light {
    font-size: 14px;
  }

  .site-nav {
    display: none;
  }

  .theme-switcher {
    margin-left: auto;
  }

  .header-cta {
    margin-left: 0;
    min-height: 42px;
    padding: 10px;
    font-size: 9px;
    white-space: nowrap;
  }

  .blog-hero {
    padding-top: 72px;
    padding-bottom: 58px;
  }

  .blog-hero h1,
  .article-header h1 {
    font-size: clamp(35px, 10.2vw, 54px);
  }

  .blog-lead {
    margin-top: 24px;
    font-size: 15px;
  }

  .posts-section {
    padding-bottom: 72px;
  }

  .post-card > a {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 32px 0;
  }

  .post-card h3 {
    font-size: 25px;
  }

  .tag-list {
    margin-top: 18px;
  }

  .post-card-arrow {
    font-size: 21px;
  }

  .blog-cta {
    margin-inline: 8px;
    padding: 48px 0;
    border-radius: 22px;
  }

  .blog-cta-inner,
  .article-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .blog-cta h2 {
    font-size: 30px;
  }

  .blog-cta .primary-button,
  .article-footer .primary-button {
    width: 100%;
  }

  .footer-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .footer-inner p {
    display: none;
  }

  .article-page {
    padding-top: 48px;
  }

  .back-link {
    margin-bottom: 36px;
  }

  .article-byline {
    gap: 8px 16px;
  }

  .article-grid {
    padding-top: 50px;
  }

  .article-content {
    font-size: 17px;
    line-height: 1.78;
  }

  .article-content h2 {
    font-size: 26px;
  }

  .article-content h3 {
    font-size: 21px;
  }

  .article-footer {
    margin-top: 60px;
    margin-bottom: 68px;
  }
}

@media (max-width: 380px) {
  .header-inner .brand-light {
    display: none;
  }
}

:root[data-theme='dark'] .site-header {
  background: rgba(16, 20, 29, .94);
  border-bottom-color: var(--line);
}

:root[data-theme='dark'] .theme-switcher {
  background: #171d28;
  border-color: #2b3546;
}

:root[data-theme='dark'] .theme-switcher button {
  color: #8792a5;
}

:root[data-theme='dark'] .theme-switcher button:hover {
  color: #d9e0ec;
}

:root[data-theme='dark'] .theme-switcher button[aria-pressed='true'] {
  background: #283449;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .32);
}

:root[data-theme='dark'] .brand img,
:root[data-theme='dark'] .footer-brand img {
  filter: invert(1) brightness(1.15);
}

:root[data-theme='dark'] .site-nav,
:root[data-theme='dark'] .tag-list span,
:root[data-theme='dark'] .article-tags span {
  color: #b9c3d3;
}

:root[data-theme='dark'] .eyebrow {
  color: var(--accent);
}

:root[data-theme='dark'] .article-content {
  color: #cdd5e2;
}

:root[data-theme='dark'] .article-content blockquote {
  color: #b8c2d2;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
