/* Shared author layout: portrait once per page, notes first, quiet essay rail.
   The DOM keeps essays after two notes so narrow screens and keyboard order agree. */
.site-shell {
  max-width: 1600px;
  padding: 40px;
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 64px;
  align-items: start;
}
.site-header {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  z-index: 30;
  top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.author-profile { display: flex; flex-direction: column; gap: 20px; white-space: normal; }
.author-profile:hover { opacity: 1; text-decoration: none; }
.author-profile:hover .author-name { color: var(--muted); }
.author-portrait { width: 144px; height: 144px; border-radius: 16px; object-fit: cover; flex: 0 0 auto; }
.author-name { font-size: 30px; line-height: 36px; max-width: 192px; transition: color 120ms ease; }
.main-navigation { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; font-size: 16px; }
.main-navigation > a { color: var(--muted); }
.main-navigation > a:hover { color: var(--ink); text-decoration: none; }
.main-navigation > a[aria-current=page] { color: var(--ink); font-weight: 500; text-decoration: none; }
.language-picker { margin: 0; }
.language-panel { inset-inline-start: 0; inset-inline-end: auto; }
.author-social-links { display: flex; gap: 4px; margin-inline-start: -11px; }
.site-body { grid-column: 2; grid-row: 1; min-width: 0; position: relative; z-index: 0; }
.main-content, .main-content.page-about { padding-top: 0; }
.language-suggestion { margin-bottom: 32px; }
.site-footer, .biography-shell .site-footer {
  grid-column: 2;
  grid-row: 2;
  border: 0;
  margin-top: 56px;
  padding-top: 24px;
}
.home-layout { display: block; }
.notes-feed { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.notes-feed.has-essays { grid-template-columns: minmax(0, 1fr) 232px; column-gap: 48px; }
.notes-feed > .post-card, .notes-feed > .feed-pagination { grid-column: 1; }
.notes-feed > .post-card ~ .post-card { border-block-start: 1px solid var(--line); }
.notes-feed .post-media { width: 100%; max-width: 260px; }
.notes-feed .post-latest .post-media { max-width: 440px; }
.notes-feed .post-previous .post-media { max-width: 280px; }
.notes-feed .media-link { width: 100%; height: auto; max-height: none; background: transparent; border-radius: 12px; }
.notes-feed .media-link img { width: 100%; height: auto; max-width: 100%; max-height: 260px; object-fit: contain; }
.notes-feed .post-latest .media-link img { max-height: 550px; }
.notes-feed .post-previous .media-link img { max-height: 350px; }
.home-essays {
  grid-column: 2;
  grid-row: 1 / span 12;
  position: sticky;
  top: 40px;
  min-width: 0;
  padding-top: 2px;
  color: var(--muted);
}
.home-essays > h2 { font-family: var(--mono); font-size: 12px; line-height: 18px; margin-bottom: 24px; }
.essay-previews { display: grid; gap: 28px; }
.essay-preview { display: grid; gap: 8px; min-width: 0; }
.essay-preview h3 { font-size: 16px; line-height: 24px; font-weight: 400; overflow-wrap: anywhere; }
.essay-preview h3 a:hover { color: var(--ink); text-decoration: none; }
.essay-preview-lead { font-size: 13px; line-height: 20px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.essay-preview-meta { font-size: 12px; line-height: 18px; }
.all-essays { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; font-size: 13px; }
[dir=rtl] .all-essays > span { transform: scaleX(-1); }
.home-layout.is-empty .notes-feed { grid-template-columns: minmax(0, 720px); }
.home-layout.is-empty .home-essays { grid-column: 1; grid-row: auto; position: static; }
.biography-page { max-width: 1060px; margin-inline: auto; gap: 64px; }
.biography-introduction { display: block; }
.biography-identity { gap: 24px; }
.biography-identity h1 { max-width: 900px; font-size: 52px; line-height: 1.2; font-weight: 500; letter-spacing: -.025em; }
.biography-lead { font-size: 20px; line-height: 31px; max-width: 760px; }
.biography-identity .biography-contact { margin: 0; padding: 0; gap: 12px; min-height: 44px; }
.biography-contact .icon { width: 22px; height: 22px; }
.company-logos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.company-logos > li { width: auto; height: 84px; }
.company-logo {
  width: 100%; height: 100%; min-width: 0; padding: 14px;
  background: var(--surface); border-radius: 12px; transform: none;
  transition: background-color 120ms ease;
}
.company-logo:hover { text-decoration: none; background: #ededed; }
.company-logo > img { max-width: 100%; height: auto; object-fit: contain; flex-shrink: 1; }
.company-logo .logo-gazprombank { width: 184px; }
.company-logo .logo-vtb { width: 86px; }
.company-logo .logo-ingosstrakh { width: 156px; }
.company-alfa { gap: 8px; }
.company-alfa > img { width: 28px; height: 28px; flex: 0 0 28px; }
.company-alfa > span { width: auto; min-width: 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.essay-index { margin: 0 auto 48px; }
.note-index { max-width: 960px; margin: 0 auto 48px; }
.note-index > h1 { font-size: 48px; font-weight: 500; letter-spacing: -.035em; margin-bottom: 60px; }
.note-index .post-title { font-size: 28px; line-height: 1.3; font-weight: 500; letter-spacing: -.02em; }
.note-index .post-text { font-size: 22px; line-height: 1.55; }
.note-index .post-media { max-width: 440px; }
.note-index .media-link img { max-height: 550px; }
.essay-hero { margin-top: 0; }
.essay-grid { grid-template-columns: 180px minmax(0, 720px); gap: 32px; max-width: 100%; }
.essay-toc { padding-inline-end: 0; }
.essay-end { margin-bottom: 24px; }

@media (min-width: 1440px) { .site-shell { padding-inline: 64px; } }
@media (min-width: 1200px) and (max-height: 740px) { .site-header { position: static; } }
@media (max-width: 1399px) {
  .essay-grid { display: block; max-width: 760px; }
  .essay-toc { position: static; max-height: none; padding: 18px 0; margin-bottom: 32px; border-block: 1px solid var(--line); }
  .essay-toc summary { margin: 0; }
  .essay-toc nav { margin-top: 18px; }
}
@media (max-width: 1199px) {
  .site-shell { display: flex; align-items: stretch; padding: 32px 40px; }
  .site-header { position: relative; top: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 48px; }
  .author-profile { flex-direction: row; align-items: center; gap: 16px; }
  .author-portrait { width: 64px; height: 64px; border-radius: 50%; }
  .author-name { max-width: none; font-size: 24px; line-height: 32px; }
  .main-navigation { width: auto; flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; font-size: 14px; }
  .language-panel { inset-inline-start: auto; inset-inline-end: 0; }
  .author-social-links { display: none; }
  .site-body { flex: 1 0 auto; width: 100%; }
  .home-essays { top: 24px; }
  .biography-identity h1 { font-size: 44px; }
}
@media (max-width: 899px) {
  .site-shell, .site-shell.biography-shell { padding: 24px; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 40px; }
  .main-navigation { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px 20px; }
  .language-picker { margin-inline-start: auto; }
  .language-panel { max-height: calc(100dvh - 190px); }
  .notes-feed, .notes-feed.has-essays { display: flex; flex-direction: column; }
  .notes-feed > * { width: 100%; }
  .home-essays { position: static; padding: 24px 0 32px; margin: 24px 0; }
  .home-essays > h2 { margin-bottom: 20px; }
  .essay-previews { gap: 24px; }
  .essay-preview h3 { font-size: 17px; line-height: 26px; }
  .essay-preview-lead { -webkit-line-clamp: 2; }
  .notes-feed > .home-essays + .post-card { border-block-start: 0; padding-top: 0; }
  .notes-feed .post-latest .media-link img { max-height: none; }
  .home-layout.is-empty .home-essays { margin: 0; padding-top: 0; }
  .biography-page { gap: 48px; }
  .biography-identity h1 { font-size: 34px; line-height: 40px; }
  .biography-lead { font-size: 17px; line-height: 27px; }
  .note-index > h1 { font-size: 36px; margin-bottom: 36px; }
  .note-index .post-title { font-size: 24px; }
  .note-index .post-text { font-size: 18px; line-height: 28px; }
  .company-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .company-logos > li { height: 80px; }
  .biography-shell .site-footer, .site-footer { margin-top: 48px; padding-top: 24px; }
  .essay-row { grid-template-columns: minmax(0, 1fr) 180px; gap: 24px; }
}
@media (max-width: 540px) {
  .author-name { font-size: clamp(20px, 5.65vw, 24px); line-height: 30px; }
  .author-profile { gap: 16px; }
  .main-navigation { gap: 4px 14px; }
  .main-navigation > a, .language-picker > summary { font-size: 13px; }
  .language-picker { position: static; }
  .main-navigation { position: relative; }
  .language-panel { top: calc(100% + 8px); }
  .essay-row { grid-template-columns: minmax(0, 1fr); }
  .essay-row img { height: auto; aspect-ratio: 16 / 9; }
  .company-logo { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .author-name, .company-logo { transition: none; } }
