@font-face {
  font-family: "Durik";
  src: url("../fonts/durik.woff2") format("woff2"),
       url("../fonts/durik.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Jikharev";
  src: url("../fonts/jikharev.woff2") format("woff2"),
       url("../fonts/jikharev.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --bg-alt: #F7F7F7;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --border: #E2E2E2;

  --accent: var(--text);

  --content-width: 1000px;
  --radius-lg: 16px;
  --radius-sm: 4px;

  /* Боковой отступ для full-bleed блоков (hero-split, stat-block) на
     главной: держит левый/правый край текста на одной линии с шапкой
     (.container — max-width var(--content-width) + padding 56px), а не
     фиксированным 120px. На узких экранах (контейнер уже не шире
     content-width) падает до 56px. */
  --side-pad: max(56px, calc((100% - var(--content-width)) / 2 + 56px));

  /* Durik/Jikharev подключаются через @font-face выше, но нигде не
     используются — оставлены на случай отдельных акцентных элементов. */
  --font-body: "Noto Serif", Georgia, "Times New Roman", serif;
  --font-display: "Alegreya", "Noto Serif", Georgia, serif;
  --font-quote: "Jikharev", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 56px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Typography */

.h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 50px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 12px;
}

.h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px;
}

.h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
}

.lead {
  font-size: 18px;
  margin: 0;
}

.body {
  font-size: 16px;
  margin: 0;
}

.small {
  font-size: 14px;
  color: var(--text-secondary);
}

.placeholder {
  color: var(--text-secondary);
  font-style: italic;
}

.quote {
  font-family: var(--font-quote);
  font-size: 20px;
  font-style: italic;
  color: var(--text);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  /* Только top/bottom — left/right остаются от .container (56px,
     на мобиле 20px), иначе шапка перебивает их через padding: 16px 0
     и меню оказывается шире остального контента. */
  padding-top: 16px;
  padding-bottom: 16px;
}

.nav__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--text);
}

.nav__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.nav__links a {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.nav__links a:hover {
  text-decoration: underline;
}

.nav__links a.active {
  font-weight: 700;
  text-decoration: underline;
}

/* Hero (главная, до реструктуризации — оставлено для об/кейсы/контент) */

.hero {
  padding: 96px 20px 72px;
}

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

.avatar {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 4px var(--border), 0 16px 32px -12px rgba(0, 0, 0, 0.15);
}

.lead--placeholder {
  color: var(--text-secondary);
  font-style: italic;
}

/* Горизонтальные блоки (главная) — плашки без цвета, разделены линиями */

.stat-blocks {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.stat-blocks > * + * {
  border-top: 1px solid var(--border);
}

.stat-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px var(--side-pad);
  color: var(--text);
  background: var(--bg);
}

.stat-block--link {
  transition: background 0.15s ease;
}

.stat-block--link:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.stat-block__date {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-block__sep {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-block__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.stat-block__extra {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-block__reading {
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-block__arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.stat-block__arrow::before {
  content: "";
  display: inline-block;
  width: 64px;
  height: 2px;
  background: currentColor;
  margin-right: 10px;
  transition: width 0.15s ease;
}

.stat-block__arrow::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
}

.stat-blocks a:hover .stat-block__arrow::before {
  width: 88px;
}

/* Sections */

.section {
  padding: 88px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section--page {
  padding-top: 56px;
}

/* Teaser blocks (главная) */

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.teaser-card__link {
  display: inline-block;
  margin-top: 16px;
  color: var(--red);
  font-weight: 700;
}

.teaser-card__link:hover {
  color: var(--blue);
}

/* Cases */

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.case-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(43, 32, 24, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -14px rgba(43, 32, 24, 0.25);
}

.placeholder-card {
  border-style: dashed;
  background: var(--bg-alt);
  box-shadow: none;
}

.placeholder-card:hover {
  transform: none;
  box-shadow: none;
}

/* About */

.about-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Article body (статьи из markdown) */

.article-meta {
  margin: 0 0 8px;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 12px 0 0;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  margin: 8px 0 0;
}

.article-body p {
  margin: 0;
  line-height: 1.7;
}

.article-body ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Content list — заголовок + стрелка, разделены линиями */

.content-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.content-list li + li {
  border-top: 1px solid var(--border);
}

.content-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  color: var(--text);
  transition: color 0.15s ease;
}

.content-link:hover {
  color: var(--text);
}

.content-link:hover .stat-block__arrow::before {
  width: 88px;
}

.content-link__title {
  font-weight: 600;
  font-size: 17px;
}

/* Footer */

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

/* Responsive */

@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding: 56px 20px 40px;
  }

  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .footer__inner {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .nav {
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav__name {
    width: 100%;
    text-align: center;
    font-size: 18px;
  }

  .nav__links {
    justify-content: center;
    width: 100%;
  }

  .stat-block {
    padding: 32px 20px;
  }

  .stat-block__date,
  .stat-block__sep {
    display: none;
  }
}
