:root {
  --bg: #f4f5f7;
  --bg-soft: #eef1f3;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #6a6d73;
  --accent: #1f6f6a;
  --accent-hover: #185954;
  --tech: #2a7a76;
  --line: rgba(28, 29, 33, 0.12);
  --line-strong: rgba(28, 29, 33, 0.18);
  --radius: 10px;
  --radius-chip: 7px;
  --shadow: 0 10px 28px rgba(28, 29, 33, 0.07);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --on-accent: #ffffff;
  --space-xs: 8px;
  --space-sm: 14px;
  --space-md: 22px;
  --space-lg: 36px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(42, 122, 118, 0.07), transparent 55%),
    radial-gradient(900px 480px at 88% 0%, rgba(28, 29, 33, 0.04), transparent 50%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 42%, var(--bg) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3 {
  line-height: 1.2;
  text-wrap: balance;
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 20px;
}

.site-nav a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* Sticky mobile bar on split home — shown ≤768px */
.home-mobile-bar {
  display: none;
}

.nav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.tag-chip,
.filter-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  background: rgba(42, 122, 118, 0.1);
  color: var(--tech);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover,
.filter-chip:hover {
  border-color: var(--tech);
  text-decoration: none;
  color: var(--tech);
}

.tag-chip.is-active,
.filter-chip.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.tag-chip.is-active:hover,
.filter-chip.is-active:hover {
  color: var(--on-accent);
}

.works-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hero {
  padding: 48px 24px 40px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 245, 247, 0.9) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.hero-kicker {
  color: var(--tech);
  font-weight: 700;
  font-size: 0.875rem;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 20px;
  color: var(--text);
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.65;
  margin: 0;
}

.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stack {
  color: var(--tech);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin: 16px 0 0;
}

.theses-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.theses-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  line-height: 1.45;
}

.home-contact {
  padding: 8px 0 48px;
}

.works-search {
  margin: 0 0 20px;
}

.works-search input {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.works-search input::placeholder {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.breadcrumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumbs span[aria-hidden] { margin: 0 6px; color: var(--muted); }

.case-cover img {
  width: 100%;
  height: auto;
  max-height: min(52vh, 520px);
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}

.case-cover--wide img {
  width: 100%;
  height: auto;
  display: block;
}

.case-cover { margin: 8px 0 20px; }

.case-hero--aside {
  display: grid;
  grid-template-columns: minmax(140px, 42%) 1fr;
  gap: 20px 28px;
  align-items: start;
  margin: 8px 0 24px;
}

.case-hero--portrait {
  grid-template-columns: minmax(260px, 46%) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: start;
}

.case-hero-media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  aspect-ratio: var(--cover-ar, 1 / 1);
  max-width: min(100%, 380px);
  max-height: min(58vh, 420px);
  width: 100%;
}

.case-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-hero--aside[data-aspect="9:16"] .case-hero-media {
  max-width: min(100%, 280px);
  max-height: min(62vh, 480px);
}

.case-hero--portrait .case-hero-media,
.case-hero--aside[data-aspect="2:3"] .case-hero-media {
  max-width: min(100%, 520px);
  max-height: min(78vh, 680px);
  width: 100%;
  justify-self: start;
}

.case-hero-copy .case-title {
  margin-top: 0;
}

.case-hero-copy .case-result-line {
  margin-top: 16px;
}

.case-hero-lead {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.case-hero--portrait .case-hero-lead {
  font-size: 1rem;
  line-height: 1.65;
}

.case-hero--portrait .case-hero-media {
  position: sticky;
  top: 24px;
}

.case-hero-body {
  margin-top: 8px;
}

.case-hero-body > :first-child {
  margin-top: 0;
}

.case-page .case-content {
  width: 100%;
}

@media (max-width: 950px) {
  .case-hero--aside,
  .case-hero--portrait {
    grid-template-columns: 1fr;
  }
  .case-hero--portrait .case-hero-media {
    justify-self: stretch;
    max-width: min(100%, 420px);
    max-height: min(55vh, 480px);
    margin-inline: auto;
    position: static;
  }
  .case-hero-media {
    max-width: min(100%, 100%);
    max-height: min(42vh, 360px);
  }
}

.case-gallery {
  margin: 36px 0 28px;
}

.case-gallery-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.case-gallery-widget {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.case-gallery-viewport {
  overflow: hidden;
}

.case-gallery-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .case-gallery-track { transition: none; }
}

.case-gallery-slide {
  min-width: 100%;
  margin: 0;
}

.case-gallery-slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  background: var(--bg);
}

.case-gallery-prev,
.case-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
}

.case-gallery-prev { left: 10px; }
.case-gallery-next { right: 10px; }

.case-gallery-prev::before,
.case-gallery-next::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  margin: 0 auto;
}

.case-gallery-prev::before { transform: rotate(45deg); }
.case-gallery-next::before { transform: rotate(-135deg); }

.case-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px 14px;
}

.case-gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--line);
  cursor: pointer;
}

.case-gallery-dot.is-active {
  background: var(--accent);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: #185954;
  text-decoration: none !important;
}

.btn-outline {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid var(--line);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(31, 111, 106, 0.08);
}

.section { padding-bottom: 48px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 22px;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  letter-spacing: -0.01em;
}

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

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 40rem;
}

.note-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.note-card:last-child {
  border-bottom: none;
}

.note-card-date {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.note-card-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.note-card-title a {
  color: inherit;
  text-decoration: none;
}

.note-card-title a:hover {
  color: var(--accent);
}

.note-card-summary {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.note-card-more a {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.related-works-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-works-list li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.related-works-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.related-works-list a {
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}

.related-works-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.note-cover {
  margin: 0;
  max-width: none;
}

.note-cover img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg);
}

/* ===== Записка: 3 колонки как главная (статика+список | картинка | текст) ===== */
body.page-note.page-home .split-home.note-split-home {
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr) minmax(0, 1fr);
}

body.page-note.page-home[data-has-cover="0"] .split-home.note-split-home {
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr);
}

body.page-note.page-home[data-has-cover="0"] .note-col-media {
  display: none !important;
}

.note-col-media,
.note-col-body {
  min-width: 0;
  min-height: 0;
}

.note-col-media {
  padding: 20px 18px 32px;
  box-sizing: border-box;
}

.note-col-media .note-cover {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: transparent;
}

.note-col-media .note-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.note-col-body {
  padding: 28px 28px 48px;
  box-sizing: border-box;
}

.note-rail {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.note-rail-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Первая колонка: превью записки (обложка | заголовок + 2 строки) — desktop и мобилка */
body.page-home .note-rail-item {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: stretch;
  min-height: 100px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-home .note-rail-item::after {
  display: none;
}

body.page-home .note-rail-item:hover {
  border-color: rgba(31, 111, 106, 0.4);
  text-decoration: none;
  color: var(--text);
}

body.page-home .note-rail-item.is-current {
  border-color: rgba(31, 111, 106, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}

body.page-home .note-rail-cover {
  display: block;
  position: relative;
  width: 100%;
  min-height: 100%;
  align-self: stretch;
  border-right: 1px solid var(--line);
  background: #f1f5f9;
  overflow: hidden;
}

body.page-home .note-rail-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.page-home .note-rail-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px 12px;
  min-width: 0;
}

body.page-home .note-rail-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

body.page-home .note-rail-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

body.page-home .note-rail-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.page-home .note-rail-item {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 104px;
  }

  body.page-home .note-rail-title {
    font-size: clamp(1.02rem, 4.5vw, 1.18rem);
  }
}

/* Expand записки на главной (колонки pf) */
body.page-home[data-expand-kind="note"] .note-expand-media {
  padding: 0;
  box-sizing: border-box;
}

body.page-home[data-expand-kind="note"] .note-expand-media .note-cover {
  margin: 0;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--line);
  background: transparent;
  max-height: none;
  display: block;
  line-height: 0;
}

body.page-home[data-expand-kind="note"] .note-expand-media .note-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  object-position: top center;
  border-radius: 9px;
}

body.page-home[data-expand-kind="note"] .note-expand-main {
  padding: 4px 4px 32px;
  box-sizing: border-box;
}

body.page-home[data-expand-kind="note"] .note-expand-main .case-title {
  margin: 8px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body.page-home[data-expand-kind="note"] .note-expand-main .case-meta {
  margin: 0;
  scroll-margin-top: 12px;
}

/* Expand «Обо мне»: крупное фото + текст (как кейс / записка) */
body.page-home[data-expand-kind="about"] .note-expand-media {
  padding: 0;
  box-sizing: border-box;
}

body.page-home[data-expand-kind="about"] .note-expand-media .about-expand-photo,
body.page-home[data-expand-kind="about"] .note-expand-media .note-cover {
  margin: 0;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--line);
  background: transparent;
  max-height: none;
  display: block;
  line-height: 0;
}

body.page-home[data-expand-kind="about"] .note-expand-media .about-expand-photo img,
body.page-home[data-expand-kind="about"] .note-expand-media .note-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  object-position: top center;
  border-radius: 9px;
}

body.page-home[data-expand-kind="about"] .about-expand-photo--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(420px, 55vh);
  aspect-ratio: 3 / 4;
  background: var(--surface);
  line-height: 1;
}

body.page-home[data-expand-kind="about"] .about-expand-photo--ph span {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 700;
  color: var(--accent);
}

body.page-home[data-expand-kind="about"] .note-expand-main {
  padding: 4px 4px 32px;
  box-sizing: border-box;
}

body.page-home[data-expand-kind="about"] .note-expand-main .split-prose {
  font-size: 1rem;
  line-height: 1.65;
}

body.page-home[data-expand-kind="about"] .about-expand-contacts {
  padding: 0 4px;
  box-sizing: border-box;
}

body.page-home[data-expand-kind="about"] .about-expand-contacts .split-block--contacts,
body.page-home[data-expand-kind="about"] .note-expand-main > .split-block--contacts {
  margin: 0 0 18px;
}

/* В expand текст только в pf-колонках — не дублировать в статике слева */
body.page-home[data-expand-kind="about"] .split-static-panel[data-panel="about"] .split-prose,
body.page-home[data-expand-kind="about"] .split-static-panel[data-panel="about"] .split-block--contacts,
body.page-home[data-expand-kind="about"] .split-static-panel[data-panel="about"] .split-cta {
  display: none;
}

body.page-home[data-expand-kind="about"] .split-block--contacts {
  margin: 0 0 22px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(31, 111, 106, 0.22);
  border-radius: 14px;
  background: rgba(31, 111, 106, 0.07);
  box-sizing: border-box;
}

body.page-home[data-expand-kind="about"] .split-block--contacts .case-title {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

body.page-home[data-expand-kind="about"] .split-block--contacts .split-panel-lead {
  margin: 0 0 10px;
}

body.page-home[data-expand-kind="about"] .split-block--contacts .split-actions {
  margin: 14px 0 0;
}

.split-static-panel[data-panel="notes"] .note-rail {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Типографика как split на главной */
.page-note .case-title {
  margin: 8px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-note .case-meta {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-note .note-lead {
  margin: 0 0 22px;
  max-width: none;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
}

.page-note .note-content {
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text);
}

.page-note .note-content p {
  margin: 0 0 1em;
}

.page-note .note-content p:last-child {
  margin-bottom: 0;
}

.note-bridge {
  margin: 0 0 1.4em;
  padding: 0.85em 1em;
  border-left: 3px solid var(--accent);
  background: rgba(31, 111, 106, 0.06);
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text);
}

.note-conclusion {
  margin: 1.6em 0 0;
  padding-top: 1em;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
  line-height: 1.5;
}

.note-format-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: rgba(31, 111, 106, 0.14);
  color: var(--accent);
}

.note-rail-body .note-format-badge {
  margin: 4px 0 0;
  display: inline-block;
}

.page-note .note-content h2 {
  margin: 1.6em 0 0.5em;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.page-note .note-content h3 {
  margin: 1.35em 0 0.4em;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.page-note .note-content ul,
.page-note .note-content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.page-note .note-content li {
  margin-bottom: 0.35em;
}

.page-note .note-content blockquote {
  margin: 1.1em 0;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.page-note .note-content a {
  color: var(--tech);
  font-weight: 500;
}

.page-note .related-works,
.page-note .related-cases {
  margin-top: 28px;
}

.page-note .case-cta {
  margin-top: 28px;
}

@media (max-width: 950px) {
  body.page-note.page-home .split-home.note-split-home,
  body.page-note.page-home[data-has-cover="0"] .split-home.note-split-home,
  body.page-note.page-home[data-pf-cols="1"] .split-home.note-split-home,
  body.page-note.page-home[data-pf-cols="2"] .split-home.note-split-home,
  body.page-note.page-home[data-pf-cols="3"] .split-home.note-split-home {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.page-note.page-home {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.page-note .split-col {
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  body.page-note .note-col-media {
    max-width: min(420px, 100%);
    margin-inline: auto;
    width: 100%;
  }
}

.case-card {
  display: grid;
  grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.case-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(31, 111, 106, 0.35);
}

.case-card-cover-link {
  display: block;
  grid-column: 1;
  grid-row: 1;
  text-decoration: none;
  min-width: 0;
}

.case-card-title a {
  color: inherit;
  text-decoration: none;
}

.case-card-title a:hover {
  color: var(--accent);
}

.case-card-cover {
  position: relative;
  width: 100%;
  line-height: 0;
  background: transparent;
  border-bottom: none;
  border-right: 1px solid var(--line);
}

.case-card-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* Флажок статуса проекта поверх обложки */
.project-flag {
  position: absolute;
  top: 12px;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 16px);
  padding: 7px 16px 7px 11px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.project-flag-ico {
  flex-shrink: 0;
  display: block;
}

.project-flag-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-flag--active {
  background: #2f8f4e;
}

.project-flag--closed {
  background: #6b7280;
}

.project-flag--in_progress {
  background: #d4a017;
  color: #1a1a1a;
}

/* В expand / тексте кейса — статус в потоке, не поверх обложки */
.split-expand-status {
  margin: 0 0 10px;
}

.split-expand-status .project-flag,
.split-expand-main .project-flag {
  position: static;
  clip-path: none;
  border-radius: 999px;
  max-width: 100%;
  box-shadow: none;
  padding: 5px 12px;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
}

.case-card-body {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 18px 16px 20px;
}

.case-card-copy {
  min-width: 0;
}

.case-card-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.1vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}

.case-card-body .tags-row {
  margin: 0 0 12px;
}

.case-card-summary {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.case-card-blurb {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.case-card-blurb-label {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

@media (max-width: 520px) {
  .cases-grid .case-card {
    grid-template-columns: 1fr;
  }

  .cases-grid .case-card-cover-link,
  .cases-grid .case-card-body {
    grid-column: 1;
    grid-row: auto;
  }

  .case-card-cover {
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .case-card-cover img {
    min-height: 0;
    height: auto;
    object-fit: contain;
  }
}

.case-result,
.case-result-line {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  line-height: 1.45;
}

.case-result-line {
  margin: 12px 0 20px;
  padding: 12px 14px;
  background: rgba(31, 111, 106, 0.08);
  border: 1px solid rgba(31, 111, 106, 0.25);
  border-radius: var(--radius);
}

.case-cta {
  margin: 32px 0 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.case-audience {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.mobile-tg-bar {
  display: none;
}

@media (max-width: 768px) {
  body:not(.page-home) {
    padding-bottom: 72px;
  }
  body:not(.page-home) .mobile-tg-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(244, 245, 247, 0.96);
    border-top: 1px solid var(--line);
  }
  .mobile-tg-bar .btn {
    display: block;
    width: 100%;
    text-align: center;
  }
  .case-result-line {
    font-size: 0.95rem;
  }
  .cases-grid {
    grid-template-columns: 1fr;
  }
  .works-filters {
    gap: 6px;
  }
  .filter-chip,
  .tag-chip {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
  .nav-tags {
    padding-bottom: 10px;
    max-height: 4.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .container {
    width: min(1100px, calc(100% - 24px));
  }
  .page-head h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.page-head { padding: 40px 0 20px; }
.page-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 16px;
}
.page-lead {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 8px;
  max-width: 42rem;
}

.page-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 28px 36px;
  margin-bottom: 40px;
}

.contact-page {
  padding: 8px 0 48px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0 32px;
  padding: 0;
  list-style: none;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.contact-card-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--tech);
}

.contact-card a {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.contact-card a:hover {
  color: var(--accent);
}

.case-page { padding: 24px 0 48px; }
.case-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 12px 0 20px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.case-meta { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.case-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 8px;
  max-width: 42rem;
}
.case-content { line-height: 1.7; }
.case-content p { margin: 0 0 1.15em; }
.case-content p:last-child { margin-bottom: 0; }
.case-content h2 {
  margin-top: 2em;
  margin-bottom: 0.55em;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.case-content h3 {
  margin-top: 1.6em;
  margin-bottom: 0.45em;
  line-height: 1.25;
}
.case-content img { max-width: 100%; height: auto; border-radius: 8px; }
.case-content code,
.case-content pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.case-content pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
}
.case-content a { color: var(--tech); }

.faq-section details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--surface);
}

.faq-section summary {
  cursor: pointer;
  font-weight: 700;
}

.related-cases { margin-top: 48px; }

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  margin-top: 56px;
  padding: 28px 0 32px;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: baseline;
  justify-content: space-between;
}

.footer-inner p { margin: 0; }

.footer-legal a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer-legal a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.empty-state,
.filter-active,
.empty-home {
  color: var(--muted);
  padding: 12px 0;
}

.page-center {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.prose { line-height: 1.7; color: var(--text); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose h1 {
  margin-top: 0;
  margin-bottom: 0.6em;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.prose h2 {
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  line-height: 1.2;
}
.prose h3 {
  margin-top: 1.5em;
  margin-bottom: 0.45em;
  line-height: 1.25;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}


@media (prefers-reduced-motion: reduce) {
  .case-card,
  .btn,
  .tag-chip,
  .filter-chip,
  .reveal {
    transition: none !important;
    animation: none !important;
  }
  .case-card:hover { box-shadow: none; }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    gap: 0;
    padding: 4px 0 12px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a:last-child { border-bottom: none; }
  .header-inner { flex-wrap: wrap; }
  .site-header .nav-toggle { margin-left: auto; }
}

/* Стек главной (телефон portrait ≤900): гамбургер вместо табов под аватаром */
@media (max-width: 900px) and (orientation: portrait) {
  .home-mobile-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .home-mobile-bar .nav-toggle { display: block; margin-left: auto; }
  .home-mobile-logo {
    font-size: 0.98rem;
    max-width: calc(100% - 56px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .home-mobile-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    gap: 0;
    padding-top: 4px;
  }
  .home-mobile-nav.is-open {
    display: flex;
  }
  .home-mobile-nav a {
    display: block;
    padding: 12px 2px;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .home-mobile-nav a:last-child { border-bottom: none; }
  .home-mobile-nav a.is-active,
  .home-mobile-nav a:hover {
    color: var(--accent);
    text-decoration: none;
  }

  body.page-home .split-nav {
    display: none !important;
  }

  /* Первый экран: меньше текста — лента кейсов ближе */
  body.page-home .split-block--theses {
    display: none !important;
  }

  body.page-home {
    padding-bottom: 0;
  }

  body.page-home .split-static-inner {
    padding: 16px 16px 20px;
  }

  body.page-home .split-brand-photo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }

  body.page-home .split-brand-top {
    gap: 12px;
    margin-bottom: 12px;
  }

  body.page-home .split-brand-top .split-lead {
    font-size: 1.05rem;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text);
  }

  /* Не дублировать «Записки автоматизатора» — оно уже в mobile-bar */
  body.page-home .split-brand-title {
    display: none;
  }

  body.page-home .split-brand-status {
    display: block;
  }

  body.page-home .split-brand-cta {
    margin-bottom: 12px;
  }

  body.page-home .split-brand-cta-main {
    width: 100%;
  }

  body.page-home .split-brand-mobile-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin: 0 0 16px;
    padding: 0;
  }

  body.page-home .split-brand-mobile-nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 6px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.01em;
  }

  body.page-home .split-brand-mobile-nav a.is-active,
  body.page-home .split-brand-mobile-nav a:hover {
    color: var(--accent);
    border-color: rgba(31, 111, 106, 0.35);
    background: rgba(31, 111, 106, 0.06);
    text-decoration: none;
  }
}

/* JS-стек (data-split-stack) — то же, если media не совпало */
body.page-home[data-split-stack="1"] .split-nav {
  display: none !important;
}

body.page-home[data-split-stack="1"] .split-block--theses {
  display: none !important;
}

body.page-home[data-split-stack="1"] .split-brand-title {
  display: none;
}

body.page-home[data-split-stack="1"] .split-brand-status {
  display: block;
}

body.page-home[data-split-stack="1"] .split-brand-top .split-lead {
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
}

body.page-home[data-split-stack="1"] .split-brand-mobile-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 0;
}

body.page-home[data-split-stack="1"] .split-brand-mobile-nav a {
  flex: 1 1 auto;
  text-align: center;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

body.page-home[data-split-stack="1"] .split-brand-mobile-nav a.is-active,
body.page-home[data-split-stack="1"] .split-brand-mobile-nav a:hover {
  color: var(--accent);
  border-color: rgba(31, 111, 106, 0.35);
  background: rgba(31, 111, 106, 0.06);
  text-decoration: none;
}

body.page-home[data-split-stack="1"] .home-mobile-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

body.page-home[data-split-stack="1"] .home-mobile-bar .nav-toggle {
  display: block;
  margin-left: auto;
}

body.page-home[data-split-stack="1"] .home-mobile-nav {
  display: none;
  flex-direction: column;
  width: 100%;
  flex-basis: 100%;
  gap: 0;
  padding-top: 4px;
}

body.page-home[data-split-stack="1"] .home-mobile-nav.is-open {
  display: flex;
}

.page-home .hero-lead {
  max-width: 36rem;
}

.theses-section h2,
.section-head h2,
.home-contact h2 {
  margin-bottom: 16px;
}

h1, h2, h3,
.hero h1,
.case-card-title,
.section-head h2 {
  font-family: var(--font-display);
}

/* ===== Home split columns (AFL-like) ===== */

.page-home {
  background:
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  overflow: hidden;
  height: 100dvh;
}

.page-home .site-header,
.page-home .site-footer {
  display: none;
}

.split-home {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.page-home[data-pf-cols="3"] .split-home {
  grid-template-columns: minmax(220px, 0.75fr) repeat(3, minmax(0, 1fr));
}

body.page-home[data-pf-cols="1"] .split-home {
  grid-template-columns: minmax(200px, 0.85fr) minmax(0, 1fr);
}

/* Expand на 3 экранах: чуть уже статика, шире media+текст */
body.page-home[data-home-expand="1"][data-pf-cols="2"] .split-home {
  grid-template-columns: minmax(200px, 0.72fr) minmax(260px, 0.95fr) minmax(0, 1.2fr);
}

body.page-home[data-home-expand="1"][data-pf-cols="1"] .split-home {
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr);
}

/* ≤1200 landscape: уже статическая колонка */
@media (max-width: 1200px) and (orientation: landscape) {
  body.page-home[data-pf-cols="1"]:not([data-split-stack="1"]) .split-home {
    grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr);
  }
}

.split-col {
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line);
}

.split-col:last-child,
.split-pf:last-of-type:not([hidden]) {
  border-right: none;
}

.split-pf[hidden] {
  display: none !important;
}

.split-static {
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(238, 241, 243, 0.95) 0%, rgba(244, 245, 247, 0.98) 100%);
}

.split-static-inner {
  padding: 28px 24px 44px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.split-brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
}

.split-brand-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 14px;
}

.split-brand-photo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.split-brand-photo:hover {
  border-color: rgba(31, 111, 106, 0.4);
  text-decoration: none;
}

.split-brand-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-brand-photo--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(31, 111, 106, 0.08);
}

.split-brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Строка «🕐 дата · на связи · город?» */
.split-brand-status {
  display: block;
  margin: 0;
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.split-brand-status-ico {
  margin-right: 4px;
}

.split-brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.split-brand-title a {
  color: var(--text);
  text-decoration: none;
}

.split-brand-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.split-brand-top .split-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 400;
  max-width: 26rem;
}

.split-brand-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 14px;
  margin: 0 0 20px;
  width: 100%;
}

.split-brand-cta-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Мобильное меню под Telegram — только стек */
.split-brand-mobile-nav {
  display: none;
}

.home-tag-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-sizing: border-box;
  z-index: 5;
}

body.page-home[data-home-tag]:not([data-split-stack="1"]) .split-home {
  grid-template-rows: auto minmax(0, 1fr);
}

body.page-home[data-home-tag]:not([data-split-stack="1"]) .split-static {
  grid-row: 1 / span 2;
}

body.page-home[data-home-tag] .home-tag-bar {
  display: flex;
  grid-column: 2 / -1;
  grid-row: 1;
}

body.page-home[data-home-tag]:not([data-split-stack="1"]) .split-pf {
  grid-row: 2;
}

body.page-home[data-split-stack="1"][data-home-tag] .home-tag-bar {
  grid-column: 1 / -1;
  order: 2;
  border-top: 1px solid var(--line);
}

body.page-home[data-split-stack="1"] .split-static {
  order: 1;
}

body.page-home[data-split-stack="1"] .split-pf {
  order: 3;
}

.home-tag-bar-label {
  margin: 0;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.home-tag-bar-clear {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.home-tag-bar-clear:hover {
  border-color: rgba(31, 111, 106, 0.4);
  background: rgba(31, 111, 106, 0.06);
}

.split-nav.split-nav--tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.split-nav.split-nav--tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.split-nav.split-nav--tabs a:hover {
  color: var(--accent);
  border-color: rgba(31, 111, 106, 0.35);
  background: rgba(31, 111, 106, 0.06);
}

.split-nav.split-nav--tabs a.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.split-panel-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.split-static-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1 1 auto;
  min-height: 0;
}

.split-static-panel.is-active {
  min-height: 100%;
}

.split-static-panel[hidden] {
  display: none !important;
}

.split-panel-lead {
  margin: 0 0 1em;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

.split-kicker {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tech);
  font-family: var(--font-display);
}

.about-photo-wrap {
  margin: 4px 0 8px;
}

.about-photo {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.split-name {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.split-name a {
  color: inherit;
  text-decoration: none;
}

.split-name a:hover {
  color: var(--accent);
}

.split-nav a.is-active {
  color: var(--accent);
}

.split-prose {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.split-prose p {
  margin: 0 0 1em;
}

.split-prose p:last-child {
  margin-bottom: 0;
}

/* «Обо мне»: тот же шрифт/кегль, что у тезисов на Главной */
.split-static-panel[data-panel="about"] .split-prose,
.split-static-panel[data-panel="about"] .split-prose p {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
}

.split-contact-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.95rem;
}

.split-contact-list li {
  margin-bottom: 8px;
}

/* Плашка контактов: статика «Обо мне» и expand */
.split-block--contacts {
  margin: 0 0 20px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(31, 111, 106, 0.22);
  border-radius: 14px;
  background: rgba(31, 111, 106, 0.07);
  box-sizing: border-box;
}

.split-block--contacts .case-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.split-block--contacts .split-panel-lead {
  margin: 0 0 10px;
}

.split-block--contacts .split-actions {
  margin: 14px 0 0;
}

.split-stack-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.split-stack-item:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.split-stack-item .split-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.split-stack-item .split-text {
  padding: 0 4px;
}

.split-portfolio-stack {
  display: none;
}

.split-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.split-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.split-nav a:hover {
  color: var(--accent);
}

.split-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--font);
  font-size: 0.95rem;
  max-width: 28rem;
}

.split-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.split-block--theses {
  border-top: none;
  padding-top: 0;
}

.split-heading {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--tech);
}

.split-theses {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 7.5rem;
}

.split-thesis {
  position: relative;
  padding: 2px 0 2px 14px;
  border-left: 2px solid rgba(31, 111, 106, 0.35);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  transition: border-color 0.35s ease, color 0.35s ease, opacity 0.35s ease;
}

.split-thesis.is-pending {
  opacity: 0.35;
}

.split-thesis.is-typing {
  border-left-color: var(--accent);
  color: var(--text);
  opacity: 1;
}

.split-thesis.is-done {
  border-left-color: rgba(31, 111, 106, 0.55);
  color: var(--text);
  opacity: 0.92;
}

.thesis-text {
  font-family: var(--font);
}

.thesis-caret {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  border-right: 2px solid var(--accent);
  height: 1em;
  vertical-align: -0.1em;
  animation: thesis-caret-blink 0.9s steps(1, end) infinite;
}

.thesis-caret[hidden] {
  display: none;
}

@keyframes thesis-caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .thesis-caret { display: none !important; }
  .split-thesis {
    opacity: 1 !important;
    color: var(--muted);
  }
}

.split-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.55;
}

.note-select {
  position: relative;
  display: inline;
  color: inherit;
}

.note-select .note-ch {
  display: inline;
  border-radius: 1px;
  transition: none;
}

.note-select .note-ch.is-sel {
  background: #2b6dff;
  color: #fff;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.note-select-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin: 0 -1px;
  vertical-align: -0.15em;
  background: #2b6dff;
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
}

.note-select-caret.is-on {
  opacity: 1;
  animation: note-caret-blink 0.85s steps(1, end) infinite;
}

.note-select-caret.is-drag {
  animation: none;
  opacity: 1;
}

@keyframes note-caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .note-select-caret { display: none !important; }
  .note-select .note-ch.is-sel {
    background: transparent;
    color: inherit;
  }
}

.split-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.split-mail {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.split-cta {
  margin-top: auto;
  padding-top: 20px;
}

/* Одна колонка / стек: CTA не у низа экрана — рядом с контентом + разделитель */
body.page-home[data-split-stack="1"] .split-cta,
body.page-home[data-pf-cols="1"] .split-cta {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

body.page-home[data-split-stack="1"] .split-panel-stack,
body.page-home[data-pf-cols="1"] .split-panel-stack,
body.page-home[data-split-stack="1"] .split-static-panel.is-active,
body.page-home[data-pf-cols="1"] .split-static-panel.is-active {
  min-height: 0;
  flex: 0 1 auto;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.page-home .split-cta {
    margin-top: 8px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
  }

  body.page-home .split-panel-stack,
  body.page-home .split-static-panel.is-active {
    min-height: 0;
    flex: 0 1 auto;
  }
}

.split-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}

.split-col.split-scroll {
  align-self: stretch;
}

.split-pf,
.split-cards {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.split-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  flex: 0 0 auto;
  position: relative;
  z-index: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

/* Мобильный стек: content-visibility ломает появление карточек/картинок в WebKit */
body.page-home[data-split-stack="1"] .split-card {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

.split-card:hover {
  border-color: rgba(31, 111, 106, 0.4);
  box-shadow: var(--shadow);
}

.split-card-link,
.split-card-surface {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.split-card-link:hover,
.split-card-surface:hover {
  text-decoration: none;
  color: inherit;
}

.split-card-cover {
  position: relative;
  width: 100%;
  line-height: 0;
  border-bottom: 1px solid var(--line);
  /* Не тянуть полную высоту 9:16 — иначе колонка «не крутится» от тяжёлых кадров */
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f1f5f9;
}

.split-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.split-card .tags-row .tag-chip {
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 7px;
  border-radius: 999px;
  border: none;
  background: rgba(42, 122, 118, 0.1);
  color: var(--tech);
}

.split-card .tags-row .tag-chip:hover {
  background: rgba(42, 122, 118, 0.18);
  color: var(--accent);
}

.split-card-body {
  padding: 18px 16px 20px;
}

.split-card-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.1vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.split-card-body .tags-row {
  margin: 0;
  gap: 4px;
}

.split-card-summary {
  margin: 10px 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted, #5c6578);
}

.split-card-blurb,
.split-text-blurb {
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted, #5c6578);
}

.split-card-blurb-label,
.split-text-blurb-label {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}

.split-card-result {
  margin: 14px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.split-card-teaser {
  margin: 8px 0 0;
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted, #5c6578);
}

.split-card-link:hover .split-card-title,
.split-card-surface:hover .split-card-title {
  color: var(--accent);
}

/*
  Компактное превью: только 1 колонка портфолио / мобилка (не expand).
  На 3 и 4 колонках экрана — развёрнутые карточки (обложка сверху).
  Обложка слева на всю высоту; справа заголовок, метки, описание.
*/
body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card {
  border-radius: 12px;
  overflow: hidden;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-link,
body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-surface {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 118px;
  padding: 0;
  box-sizing: border-box;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-cover {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: 100%;
  min-height: 118px;
  height: 100%;
  align-self: stretch;
  aspect-ratio: auto;
  border-bottom: none;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-right: 1px solid var(--line);
  background: #f1f5f9;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px 14px;
  min-width: 0;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-title {
  margin: 0;
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-body .tags-row {
  margin: 0;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-teaser {
  margin: 0;
  font-family: var(--font);
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card .project-flag {
  top: 6px;
  left: 0;
  gap: 0;
  padding: 3px 8px 3px 5px;
  font-size: 0;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card .project-flag-label {
  display: none;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card .project-flag-ico {
  width: 11px;
  height: 11px;
}

body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf,
body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-pf-cards {
  gap: 10px;
  padding: 12px;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-link,
body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-surface {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 104px;
  }

  body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-body {
    padding: 10px 12px 12px;
    gap: 6px;
  }

  body.page-home[data-pf-cols="1"]:not([data-home-expand="1"]) .split-pf .split-card-teaser {
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
  }
}

/* 3–4 колонки: полная обложка сверху + teaser */
body.page-home[data-pf-cols="2"] .split-pf .split-card-teaser,
body.page-home[data-pf-cols="3"] .split-pf .split-card-teaser {
  margin: 10px 0 0;
  font-family: var(--font);
}

.split-all-works {
  margin: 8px 0 24px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
}

.split-texts {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

.split-text-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.split-text-title a {
  color: var(--text);
  text-decoration: none;
}

.split-text-title a:hover {
  color: var(--accent);
}

.split-text-summary {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.split-text-result {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1.5;
}

.split-text-more {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.split-empty {
  padding: 24px;
  color: var(--muted);
}

/* —— Inline expand: статика на месте, stage сверху, карточки вниз —— */
.split-pf {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-reading {
  overflow: hidden !important;
  padding: 0 !important;
  scroll-behavior: auto;
}

.split-pf-cards {
  position: relative;
  z-index: 1;
  transition: opacity 0.35s ease;
}

/* Stage привязан к видимой области колонки; без transform на scrollport */
.split-pf-stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--surface);
  padding: 20px 16px 40px;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
  transform: none !important;
}

.split-pf-stage[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.split-pf-stage-inner {
  transform: none !important;
  opacity: 0;
  transition: opacity 0.25s ease;
  margin: 0;
  padding: 0;
}

body.page-home[data-home-expand="1"].is-expand-ready .split-pf.is-expand-reading > .split-pf-cards {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: none !important;
}

body.page-home[data-home-expand="1"].is-expand-ready .split-pf.is-expand-reading > .split-pf-stage {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

body.page-home[data-home-expand="1"].is-expand-ready .split-pf.is-expand-reading > .split-pf-stage > .split-pf-stage-inner {
  transform: none !important;
  opacity: 1;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host > .split-pf-cards {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  gap: 10px;
  z-index: 7;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host > .split-pf-stage {
  display: none !important;
}

/* При expand: 1-я и 4-я колонки затемняются на 30% — центр (статья/кейс) светлее и цельный */
body.page-home[data-home-expand="1"] .split-static,
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host {
  position: relative;
}

body.page-home[data-home-expand="1"] .split-static::after,
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(28, 29, 33, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

body.page-home[data-home-expand="1"].is-expand-ready .split-static::after,
body.page-home[data-home-expand="1"].is-expand-ready .split-pf.is-expand-cards-host::after {
  opacity: 1;
}

/* Десктоп: клик по затемнённой 1-й колонке = закрыть кейс/записку */
body.page-home[data-home-expand="1"].is-expand-ready .split-static::after {
  pointer-events: auto;
  cursor: pointer;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-reading {
  background: var(--surface);
  z-index: 2;
  border-right-color: rgba(28, 29, 33, 0.06);
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-reading .split-pf-stage {
  background: var(--surface);
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-reading + .split-pf.is-expand-reading {
  box-shadow: none;
}

/* Мобильный стек — без затемнения и без клика-закрытия по колонке */
body.page-home[data-split-stack="1"][data-home-expand="1"] .split-static::after,
body.page-home[data-split-stack="1"][data-home-expand="1"] .split-pf.is-expand-cards-host::after {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.page-home[data-home-expand="1"] .split-static::after,
  body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host::after {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* 4-я колонка: компактные карточки проектов (превью | название+метки) */
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact {
  border-radius: 10px;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-link,
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-surface {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0 12px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  box-sizing: border-box;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-cover {
  position: relative;
  width: 64px;
  height: 64px;
  border-bottom: none;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1f5f9;
  flex-shrink: 0;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .project-flag {
  top: 4px;
  left: 0;
  gap: 0;
  padding: 3px 8px 3px 5px;
  font-size: 0;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .project-flag-label {
  display: none;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .project-flag-ico {
  width: 11px;
  height: 11px;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-body {
  padding: 0;
  min-width: 0;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .tags-row {
  margin: 0;
  gap: 4px;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .tag-chip {
  font-size: 0.68rem;
  padding: 2px 6px;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-summary,
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-blurb,
body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact .split-card-result {
  display: none !important;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact:not(.is-current)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(28, 29, 33, 0.3);
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 0.45s ease;
}

body.page-home[data-home-expand="1"].is-expand-ready .split-pf.is-expand-cards-host .split-card--compact:not(.is-current)::after {
  opacity: 1;
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-card--compact.is-current {
  z-index: 8;
  background: var(--surface);
  border-color: rgba(31, 111, 106, 0.45);
  box-shadow: 0 0 0 1px rgba(31, 111, 106, 0.12);
}

body.page-home[data-home-expand="1"] .split-pf.is-expand-cards-host .split-all-works--compact {
  margin: 6px 2px 0;
  font-size: 0.85rem;
}

body.page-home[data-home-expand="1"] .split-expand-cover {
  overflow: visible;
  max-height: none;
  line-height: 0;
}

body.page-home[data-home-expand="1"] .split-expand-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  object-position: top center;
}

body.page-home[data-home-expand="1"] .split-expand-title,
body.page-home[data-home-expand="1"] .case-title {
  scroll-margin-top: 12px;
}

.split-back-fab {
  position: absolute;
  z-index: 30;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-back-fab:hover {
  color: var(--accent);
  border-color: rgba(31, 111, 106, 0.35);
}

.split-back-fab[hidden] {
  display: none !important;
}

.split-expand-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 0 24px;
  margin: 0;
}

.note-expand-stack {
  gap: 28px;
}

/* Мобилка: шапка бренда на месте; rail списка скрыт (карточки — под текстом записки) */
body.page-home[data-split-stack="1"][data-home-expand="1"][data-expand-kind="note"] .split-static {
  display: block;
  order: 1;
}

body.page-home[data-split-stack="1"][data-home-expand="1"][data-expand-kind="note"] .split-static-panel[data-panel="notes"] .note-rail {
  display: none !important;
}

body.page-home[data-split-stack="1"][data-home-expand="1"][data-expand-kind="note"] .split-pf {
  order: 2;
}

body.page-home .note-rail--others {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

body.page-home .note-rail--others .split-heading {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

@media (prefers-reduced-motion: reduce) {
  .split-pf-cards,
  .split-pf-stage,
  .split-pf-stage-inner {
    transition: none;
  }

  .split-pf-stage-inner {
    transform: none;
    opacity: 1;
  }
}

/* legacy close panel removed — кнопка .split-back-fab */
.split-expand-close {
  display: none !important;
}

.split-expand-media {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.case-expand-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.case-expand-gallery-stage {
  margin: 0;
}

.case-expand-gallery-main {
  display: block;
  width: 100%;
  height: auto;
}

.case-expand-gallery-caption {
  display: block;
  margin: 0;
  padding: 14px 16px 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--text);
  background: rgba(31, 111, 106, 0.06);
  border-top: 2px solid rgba(31, 111, 106, 0.35);
}

.case-expand-gallery-caption[hidden] {
  display: none;
}

.case-expand-gallery-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.case-expand-gallery-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-expand-gallery-thumb:hover {
  border-color: rgba(31, 111, 106, 0.45);
}

.case-expand-gallery-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(31, 111, 106, 0.18);
}

.case-expand-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.case-expand-gallery-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.split-expand-cover {
  margin: 0;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--line);
  background: transparent;
  line-height: 0;
  max-height: none;
}

.split-expand-shot {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: transparent;
}

.split-expand-cover img,
.split-expand-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* Кейсы в expand — как записки: верх не режется */
body.page-home[data-home-expand="1"][data-expand-kind="case"] .split-expand-cover,
body.page-home[data-home-expand="1"] .split-expand-col--media .split-expand-cover {
  overflow: visible;
  max-height: none;
  line-height: 0;
}

body.page-home[data-home-expand="1"][data-expand-kind="case"] .split-expand-cover img,
body.page-home[data-home-expand="1"] .split-expand-col--media .split-expand-cover img,
body.page-home[data-home-expand="1"][data-expand-kind="case"] .case-expand-gallery-main,
body.page-home[data-home-expand="1"] .split-expand-col--media .case-expand-gallery-main {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  object-position: top center;
  border-radius: 9px;
}

body.page-home[data-home-expand="1"] .split-expand-col--media {
  padding-top: 0;
  min-width: 0;
}

.split-expand-shot figcaption {
  margin: 0;
  padding: 14px 16px 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--text);
  background: rgba(31, 111, 106, 0.06);
  border-top: 2px solid rgba(31, 111, 106, 0.35);
}

.split-expand-identity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-expand-identity.is-under-cover {
  margin: 4px 0 8px;
  order: 0;
}

.split-expand-media > .split-expand-identity.is-under-cover {
  margin: 2px 0 4px;
}

.split-expand-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
}

.split-expand-main > .case-title.split-expand-title,
.split-expand-main > .split-expand-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.split-expand-main > .tags-row {
  margin: 0 0 18px;
}

.split-expand-head .tags-row {
  margin: 0;
}

.split-expand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.split-expand-main,
.split-expand-rest,
.split-expand-col--all {
  font-size: 0.98rem;
  line-height: 1.65;
}

.split-expand-summary {
  margin: 0 0 12px;
  color: var(--muted);
}

.split-expand-blurb {
  margin: 0 0 10px;
  color: var(--text);
}

.split-expand-blurb-label {
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}

.split-expand-result {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
}

.split-expand-intro {
  margin-top: 8px;
}

.split-expand-rest.case-content > :first-child,
.split-expand-intro.case-content > :first-child {
  margin-top: 0;
}

/* Мобильный портрет: стек (JS data-split-stack + CSS fallback) */
body.page-home[data-split-stack="1"] {
  overflow-x: hidden;
  overflow-y: auto !important;
  height: auto !important;
  max-height: none !important;
}

/* На стеке скроллится только страница — не вложенные колонки (иначе touch «залипает») */
body.page-home[data-split-stack="1"] .split-static,
body.page-home[data-split-stack="1"] .split-pf,
body.page-home[data-split-stack="1"][data-home-expand="1"] .split-pf.is-expand-reading {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

body.page-home[data-split-stack="1"] .split-static-inner {
  height: auto;
  min-height: 0;
}

body.page-home[data-split-stack="1"][data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-cards {
  display: none;
}

body.page-home[data-split-stack="1"][data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-stage {
  display: block !important;
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  max-height: none;
  overflow: visible !important;
}

body.page-home[data-split-stack="1"][data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-stage > .split-pf-stage-inner {
  transform: none;
  opacity: 1;
}

body.page-home[data-split-stack="1"] .split-back-fab {
  position: fixed;
  left: 50%;
  top: auto;
  bottom: 18px;
  transform: translateX(-50%);
}

@media (max-width: 900px) and (orientation: portrait) {
  html {
    overflow-x: hidden;
  }

  body.page-home {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
  }

  body.page-home .split-static,
  body.page-home .split-pf,
  body.page-home[data-home-expand="1"] .split-pf.is-expand-reading {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  body.page-home .split-static-inner {
    height: auto;
    min-height: 0;
  }

  body.page-home[data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-cards {
    display: none;
  }

  body.page-home[data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-stage {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow: visible !important;
    max-height: none;
  }

  body.page-home[data-home-expand="1"] .split-pf.is-expand-reading > .split-pf-stage > .split-pf-stage-inner {
    transform: none;
    opacity: 1;
  }

  body.page-home .split-back-fab {
    position: fixed;
    left: 50%;
    top: auto;
    bottom: 18px;
    transform: translateX(-50%);
  }
}

body.page-home[data-split-stack="1"] .split-home,
body.page-home[data-split-stack="1"][data-pf-cols="1"] .split-home,
body.page-home[data-split-stack="1"][data-pf-cols="2"] .split-home,
body.page-home[data-split-stack="1"][data-pf-cols="3"] .split-home {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
  overflow: visible;
}

body.page-home[data-split-stack="1"] .split-col {
  border-right: none;
  border-bottom: 1px solid var(--line);
  overflow: visible !important;
}

body.page-home[data-split-stack="1"] .split-static-inner {
  min-height: auto;
}

body.page-home[data-split-stack="1"] .split-pf {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding: 16px;
}

body.page-home[data-split-stack="1"] .split-scroll {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.page-home .split-home,
  body.page-home[data-pf-cols="1"] .split-home,
  body.page-home[data-pf-cols="2"] .split-home,
  body.page-home[data-pf-cols="3"] .split-home {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.page-home .split-col {
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible !important;
  }

  body.page-home .split-static-inner {
    min-height: auto;
    height: auto;
  }

  body.page-home .split-pf {
    overflow: visible !important;
    height: auto;
    max-height: none;
    padding: 16px;
  }
}

/*
  Телефон portrait ≤900px: вертикальный стек.
  Landscape — отдельный блок ниже (2 колонки).
*/
@media (max-width: 900px) and (orientation: portrait) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.page-home {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 100dvh;
  }

  body.page-home .home-mobile-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }

  body.page-home .home-mobile-bar .nav-toggle {
    display: block;
    margin-left: auto;
  }

  body.page-home .split-nav {
    display: none !important;
  }

  body.page-home .split-block--theses {
    display: none !important;
  }

  body.page-home .split-brand-title {
    display: none;
  }

  body.page-home .split-brand-status {
    display: block;
  }

  body.page-home .split-brand-mobile-nav {
    display: flex;
  }

  body.page-home .split-home {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.page-home #split-portfolio-source,
  body.page-home #split-notes-source,
  body.page-home #split-about-source {
    display: none !important;
  }

  body.page-home .split-static,
  body.page-home .split-pf,
  body.page-home .split-scroll {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
    position: relative;
  }

  body.page-home .split-static-inner {
    height: auto !important;
    min-height: 0 !important;
  }

  body.page-home .split-pf[hidden] {
    display: none !important;
  }

  body.page-home .split-pf:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-pf .split-pf-cards {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-pf .split-pf-stage {
    display: none !important;
    position: static !important;
    inset: auto !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-card {
    content-visibility: visible !important;
    contain: none !important;
  }
}

/* Телефон landscape ≤900px: две колонки (бренд | кейсы) */
@media (max-width: 900px) and (orientation: landscape) {
  html {
    overflow: hidden;
  }

  body.page-home {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  body.page-home .home-mobile-bar {
    display: none !important;
  }

  body.page-home .split-nav {
    display: none !important;
  }

  body.page-home .split-block--theses {
    display: none !important;
  }

  body.page-home .split-brand-title {
    display: block;
    font-size: 1rem;
  }

  body.page-home .split-brand-status {
    display: block;
  }

  body.page-home .split-brand-mobile-nav {
    display: flex;
    margin-bottom: 10px;
  }

  body.page-home .split-brand-top .split-lead {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  body.page-home .split-home {
    display: grid !important;
    grid-template-columns: minmax(168px, 0.78fr) minmax(0, 1.22fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.page-home #split-portfolio-source,
  body.page-home #split-notes-source,
  body.page-home #split-about-source {
    display: none !important;
  }

  body.page-home .split-static {
    height: 100% !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: auto !important;
    flex: none !important;
  }

  body.page-home .split-static-inner {
    height: auto !important;
    min-height: 0 !important;
    padding: 12px 12px 16px !important;
  }

  body.page-home .split-pf,
  body.page-home .split-scroll {
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: auto !important;
    flex: none !important;
    position: relative;
  }

  body.page-home .split-pf[hidden] {
    display: none !important;
  }

  body.page-home .split-pf:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-pf .split-pf-cards {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-pf .split-pf-stage {
    display: none !important;
    position: static !important;
    inset: auto !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.page-home:not([data-home-expand="1"]) .split-card {
    content-visibility: visible !important;
    contain: none !important;
  }

  body.page-home[data-home-tag] .home-tag-bar {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: start;
  }
}
