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

@font-face {
  font-family: "Ruslan Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ruslan-display-latin.woff2") format("woff2"),
       url("../fonts/ruslan-display.ttf") format("truetype");
  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: #fafaf9;
  --bg-subtle: #f2f2ef;
  --text: #18181b;
  --text-muted: #52525b;
  --text-subtle: #71717a;
  --border: #e4e4e7;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-heading: "Ruslan Display", serif;
  --text-body: 1.0625rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--text);
}

.screen {
  min-height: 100dvh;
  width: 100%;
  padding: clamp(2rem, 5vw, 5.5rem) clamp(1.25rem, 5vw, 6rem);
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: start;
}

.about-pane {
  position: sticky;
  top: 3rem;
  max-width: 560px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-header > div {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: clamp(180px, 20vw, 256px);
  height: clamp(180px, 20vw, 256px);
  border-radius: 6%;
  object-fit: cover;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  flex-shrink: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
}

.bio {
  color: var(--text-muted);
  font-size: var(--text-body);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.bio p {
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  overflow-wrap: break-word;
}

.bio blockquote,
.bio-quote {
  border-left: 2px solid var(--text);
  padding: 0.25rem 0 0.25rem 0.85rem;
}

.bio blockquote {
  font-style: italic;
}

.bio-quote {
  margin: 0.15rem 0;
}

.bio-quote-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  user-select: none;
}

.bio-quote-summary::-webkit-details-marker {
  display: none;
}

.bio-quote-summary::marker {
  display: none;
  content: "";
}

.bio-quote-summary:focus {
  outline: none;
}

.bio-quote-summary:focus-visible {
  outline: 2px solid var(--border);
  outline-offset: 4px;
  border-radius: 4px;
}

.bio-quote-chevron {
  flex-shrink: 0;
  color: var(--text-subtle);
  transition: transform 0.2s ease, color 0.15s ease;
}

.bio-quote-summary:hover .bio-quote-chevron,
.bio-quote[open] .bio-quote-chevron {
  color: var(--text);
}

.bio-quote[open] .bio-quote-chevron {
  transform: rotate(180deg);
}

.bio-quote-body {
  margin-top: 0.65rem;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-style: normal;
}

.meta-list {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.meta-list span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: inline-block;
  width: 6.5rem;
}

.nav-links {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.content-pane {
  border-left: 1px solid var(--border);
  padding-left: clamp(1.5rem, 4vw, 3.5rem);
  min-height: 22rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 861px) {
  .content-pane {
    position: sticky;
    top: 3rem;
    max-height: calc(100dvh - 6rem);
  }
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.rss-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  text-decoration: none;
}

.rss-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.post-list::-webkit-scrollbar {
  width: 4px;
}

.post-list::-webkit-scrollbar-track {
  background: transparent;
}

.post-list::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.post-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-subtle);
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-item time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.post-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: none;
  border: none;
  padding: 0.15rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-subtle);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.12s ease;
}

.action-btn:hover {
  color: var(--text);
}

.upvote-btn.is-upvoted {
  color: var(--text);
}

.upvote-btn.is-upvoted svg {
  transform: translateY(-1px);
}

.action-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background-color: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.action-btn[data-tooltip]:hover::after,
.action-btn[data-tooltip].is-copied::after {
  opacity: 1;
  transform: translateY(0);
}

.post-link {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.01em;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.post-link:hover {
  text-decoration: underline;
}

.post-summary {
  font-size: 0.925rem;
  color: var(--text-muted);
}

.post-page {
  max-width: 780px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.back-link {
  text-decoration: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.post-header {
  margin-bottom: 2.25rem;
}

.post-header time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.prose {
  font-size: var(--text-body);
  line-height: 1.7;
  overflow-wrap: break-word;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-wrap: balance;
  hyphens: manual;
}

.prose h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.prose h2 {
  font-size: clamp(1.3rem, 1.8vw, 1.45rem);
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: clamp(1.12rem, 1.4vw, 1.22rem);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.prose p,
.prose li,
.prose blockquote {
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--text);
  hyphens: none;
}

.prose pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1rem 1.15rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.55;
  hyphens: none;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose blockquote {
  border-left: 2px solid var(--text);
  padding-left: 1.15rem;
  font-style: italic;
}

.post-footer-nav {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
}

@media (max-width: 860px) {
  .screen {
    padding: 2rem 1.25rem 3rem;
  }

  .split-layout {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .about-pane {
    position: static;
    max-width: 100%;
  }

  .profile-header {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .avatar {
    width: clamp(76px, 20vw, 96px);
    height: clamp(76px, 20vw, 96px);
    border-radius: 8px;
  }

  h1 {
    font-size: clamp(1.4rem, 6vw, 1.85rem);
    line-height: 1.15;
    text-wrap: balance;
  }

  .content-pane {
    position: static;
    max-height: none;
    min-height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 2rem;
  }

  .post-list {
    overflow-y: visible;
    padding-right: 0;
  }
}
