/* Blog styles. Same design language as the app shell: near-black canvas,
   Manrope for running text, Geologica for headlines, square corners, 1px
   seams instead of borders, and a white primary action. Orange is reserved
   for state, exactly as in the product. */
@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/geologica-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/geologica-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/geologica-latin.woff2') format('woff2');
  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: 'Geologica';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/geologica-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/unbounded-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/unbounded-latin.woff2') format('woff2');
  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;
}

:root {
  color-scheme: light;
  --bg-0: #F6F3EE;
  --bg-1: #FCFBF9;
  --bg-2: #EFECE6;
  --ink-0: #141210;
  --ink-1: #4A453F;
  --ink-2: #6E6860;
  --accent: #E8601C;
  --on-accent: #FFFFFF;
  --seam: rgba(20, 18, 16, 0.08);
  --salt: #141210;
  --on-salt: #FFFFFF;
  --glass: rgba(246, 243, 238, 0.88);
  --shadow-card: 0 2px 12px rgba(20, 18, 16, 0.05);
  --nav-h: 52px;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Geologica', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-wordmark: 'Unbounded', 'Geologica', -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root.dark, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #141210;
  --bg-1: #1E1B18;
  --bg-2: #292522;
  --ink-0: #F5F3EE;
  --ink-1: #C7C1B8;
  --ink-2: #9C968C;
  --accent: #E8601C;
  --on-accent: #FFFFFF;
  --seam: rgba(255, 255, 255, 0.08);
  --salt: #F5F3EE;
  --on-salt: #141210;
  --glass: rgba(20, 18, 16, 0.88);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0 0 auto;
  height: 320px;
  z-index: -1;
  background:
    radial-gradient(52% 88% at 22% 0%, rgba(232, 96, 28, 0.14) 0%, rgba(232, 96, 28, 0) 72%),
    radial-gradient(48% 82% at 78% 0%, rgba(14, 165, 233, 0.10) 0%, rgba(14, 165, 233, 0) 72%);
}
:root.dark body::before, :root[data-theme="dark"] body::before {
  background:
    radial-gradient(52% 88% at 22% 0%, rgba(232, 96, 28, 0.18) 0%, rgba(232, 96, 28, 0) 72%),
    radial-gradient(48% 82% at 78% 0%, rgba(14, 165, 233, 0.14) 0%, rgba(14, 165, 233, 0) 72%);
}
a {
  color: var(--ink-0);
  text-decoration: underline;
  text-decoration-color: var(--seam);
  text-underline-offset: 3px;
  transition: color 150ms var(--ease), text-decoration-color 150ms var(--ease);
}
a:hover { color: var(--salt); text-decoration-color: currentColor; }
a:focus-visible { outline: 1px solid var(--salt); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* Top bar: the same 52 px seam, glass and wordmark as the app shell. */
.site {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: 0 1px 0 var(--seam);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
}
.brand img { width: 16px; height: 16px; flex: none; }
.brand span {
  color: var(--salt);
  font-family: var(--font-wordmark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}
.brand:hover span { color: var(--salt); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a:not(.cta-small) {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms var(--ease);
}
.site-nav a:not(.cta-small):hover { color: var(--salt); }
.cta-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 150ms var(--ease), transform 150ms var(--ease);
}
.cta-small:hover { color: var(--on-accent); filter: brightness(1.06); }
.cta-small:active { transform: scale(0.98); filter: brightness(0.92); }

.wrap { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 36px;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--salt); }
.crumbs span { opacity: 0.55; }

.article { max-width: 720px; }
h1 {
  margin: 0 0 18px;
  color: var(--salt);
  font-family: var(--font-display);
  font-size: clamp(34px, 5.2vw, 52px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.meta {
  margin: 0 0 40px;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.toc {
  margin: 0 0 44px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-1);
  box-shadow: var(--shadow-card);
}
.toc-title {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.toc ol { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; }
.toc li {
  margin: 0 0 7px;
  break-inside: avoid;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}
.toc a { color: var(--ink-1); text-decoration: none; }
.toc a:hover { color: var(--salt); }

h2 {
  margin: 52px 0 16px;
  color: var(--salt);
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
h3 {
  margin: 30px 0 8px;
  color: var(--salt);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 20px; }
li { margin: 0 0 9px; }
li::marker { color: var(--ink-2); }
strong { color: var(--salt); font-weight: 600; }

blockquote {
  margin: 26px 0;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-1);
  box-shadow: var(--shadow-card);
  color: var(--ink-0);
}
blockquote p:last-child { margin-bottom: 0; }

code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--salt);
  font-family: var(--font-sans);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
pre {
  margin: 0 0 22px;
  padding: 16px 20px;
  border-radius: 16px;
  overflow-x: auto;
  background: var(--bg-1);
  box-shadow: var(--shadow-card);
}
pre code { padding: 0; background: none; }
hr { border: 0; height: 1px; background: var(--seam); margin: 36px 0; }

.table-scroll, .article > table { display: block; overflow-x: auto; border-radius: 16px; box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14px; background: var(--bg-1); border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; box-shadow: inset 0 -1px 0 var(--seam); }
thead th { color: var(--salt); font-weight: 600; background: var(--bg-2); }

.cta {
  margin: 56px 0 0;
  padding: 32px;
  border-radius: 16px;
  background: var(--bg-1);
  box-shadow: var(--shadow-card);
}
.cta-title {
  margin: 0 0 10px;
  color: var(--salt);
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.cta p { margin: 0 0 18px; }
.cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 0 !important; }
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: filter 150ms var(--ease), transform 150ms var(--ease);
}
.cta-button:hover { color: var(--on-accent); filter: brightness(1.06); }
.cta-button:active { transform: scale(0.98); filter: brightness(0.92); }
.cta-link { color: var(--ink-2); font-size: 13px; }
.cta-link:hover { color: var(--salt); }

.index-title { margin: 8px 0 14px; }
.index-lede { max-width: 620px; margin: 0 0 44px; color: var(--ink-1); font-size: 17px; }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.card { margin: 0; padding: 24px 28px; border-radius: 16px; background: var(--bg-1); box-shadow: var(--shadow-card); }
.card + .card { box-shadow: var(--shadow-card); }
.card a { display: block; color: inherit; text-decoration: none; }
.card a:hover { color: inherit; }
.card h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card p { margin: 0 0 16px; color: var(--ink-1); font-size: 15px; line-height: 1.6; }
.card-more {
  color: var(--salt);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-decoration-color: var(--seam);
  text-underline-offset: 4px;
}
.card a:hover .card-more { text-decoration-color: currentColor; }

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 26px 56px;
  box-shadow: inset 0 1px 0 var(--seam);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
}
.foot-brand {
  margin: 0 0 10px;
  color: var(--salt);
  font-family: var(--font-wordmark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}
.site-footer p { max-width: 560px; margin: 0 0 14px; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--salt); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .site { padding: 0 16px; }
  .site-nav { gap: 12px; }
  .site-nav a:not(.cta-small) { display: none; }
  .wrap { padding: 44px 18px 72px; }
  h1 { font-size: clamp(30px, 8vw, 40px); }
  .toc { padding: 18px 20px; }
  .toc ol { columns: 1; }
  .cta { padding: 24px 20px; }
  .card { padding: 24px 0; }
  .site-footer { padding: 28px 18px 48px; }
}