/* =========================================================
   Модуль — портфолио. Стиль по modul_design.md
   «gallery wall behind a white mat»
   ========================================================= */

:root {
  --paper: #ffffff;
  --tile: #f5f5f5;
  --ink: #0b0b0b;
  --muted: rgba(0, 0, 0, 0.486);   /* Muted Graphite #838383 */
  --chip: rgba(0, 0, 0, 0.063);    /* Chip Mist #efefef */
  --faint: rgba(0, 0, 0, 0.267);   /* Faint Ash #bbbbbb */
  --hairline: rgba(0, 0, 0, 0.063);
  --glass: rgba(0, 0, 0, 0.447);   /* Glass Smoke */
  --magenta: #f900a3;
  --violet: #af6eff;
  --holo: linear-gradient(115deg, #ff39bc 0%, #ffcf00 18%, #00ecb0 36%, #00c1ff 54%, #b460ff 72%, #ff46c5 86%, #ffcf00 100%);

  /* Elevation */
  --ring-glass: oklch(1 0 0 / 0.16) 0 0 0 1px inset;
  --avatar-hairline: oklch(0 0 0 / 0.06) 0 1px 2px 0, oklch(0 0 0 / 0.05) 0 0 0 1px;
  --holo-bevel: oklch(1 0 0 / 0.7) 0 1px 1px 0 inset, oklch(0.25 0.12 300 / 0.22) 0 -1px 2px 0 inset, oklch(0.25 0.12 300 / 0.18) 0 1px 3px 0;
  --pill-lift: oklch(0 0 0 / 0.08) 0 0 0 0.5px, oklch(0 0 0 / 0.2) 0 1px 1px -1px, oklch(0 0 0 / 0.08) 0 1px 2px 0;

  /* Layout */
  --sidebar: 252px;
  --col: 316px;
  --gap: 12px;
  --radius: 8px;
  --control: 28px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 0.12s;
  --base: 0.18s;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }

.faint { color: var(--faint); }

/* ---------- App shell ---------- */
.app {
  display: flex;
  max-width: 1680px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- Pills / buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--control);
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 13px;
  line-height: 18.2px;
  letter-spacing: -0.04px;
  white-space: nowrap;
  transition: background-color var(--base) var(--ease), color var(--base) var(--ease), opacity var(--base) var(--ease), transform var(--fast) var(--ease);
  user-select: none;
}
.pill:active { transform: scale(0.97); }

.pill--raised { background: var(--paper); color: var(--ink); box-shadow: var(--pill-lift); }
.pill--raised:hover { background: #fafafa; }
.pill--chevron { padding: 0 4px 0 12px; }

.pill--black { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.pill--black:hover { opacity: 0.86; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar);
  width: var(--sidebar);
  height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: var(--paper);
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo__mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.logo__name { font-size: 13px; font-weight: 500; letter-spacing: -0.04px; }

.burger { display: none; }

.nav { display: flex; flex-direction: column; gap: 24px; }
.nav__group { display: flex; flex-direction: column; align-items: flex-start; }
.nav__label { color: var(--faint); margin-bottom: 6px; line-height: 18.2px; }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 14px 2px 0;
  line-height: 18.2px;
  color: var(--muted);
  letter-spacing: -0.04px;
  transition: color var(--base) var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--ink);
}

/* «new» marker */
.new-marker {
  position: relative;
  color: var(--magenta);
  font-size: 12px;
  line-height: 16.8px;
  padding-bottom: 3px;
}
.new-marker::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -2px;
  bottom: -1px;
  height: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 5' preserveAspectRatio='none'%3E%3Cpath d='M1 3.2C4 1 6 4.4 9 2.4s5 1.9 8 .2 5.2 1.7 8.2-.1c1.6-.9 2.8-.5 3.8.3' fill='none' stroke='%23f900a3' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 24px; }

.cta { padding-top: 16px; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 12px; }
.cta__pitch { font-weight: 500; line-height: 18.2px; letter-spacing: -0.04px; }
.cta__row { display: flex; align-items: center; gap: 8px; }
.cta__meta { color: var(--muted); }

.sidebar__footer { display: flex; align-items: center; justify-content: space-between; }
.sidebar__footer-links { display: inline-flex; gap: 12px; color: var(--muted); }
.sidebar__footer-links a:hover { color: var(--ink); }

/* ---------- Main ---------- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 16px 48px;
}

.titlebar, .toolbar, .feed, .empty { max-width: calc(var(--col) * 4 + var(--gap) * 3); }

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--control);
  margin-bottom: 16px;
}
.titlebar__title { font-size: 16px; font-weight: 500; line-height: 22.4px; }
.titlebar__tagline { color: var(--muted); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: var(--control);
  padding: 0 12px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 13px;
  line-height: 18.2px;
  letter-spacing: -0.04px;
  white-space: nowrap;
  transition: background-color var(--base) var(--ease), color var(--base) var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); }

.sort { position: relative; flex: 0 0 auto; }
.sort__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 180px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--pill-lift), 0 8px 24px -8px rgba(0, 0, 0, 0.12);
  animation: menu-in var(--base) var(--ease);
}
.sort__menu li {
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sort__menu li:hover { background: var(--chip); color: var(--ink); }
.sort__menu li[aria-selected="true"] { color: var(--ink); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Masonry feed ---------- */
.feed {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.feed__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

.card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile);
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(6px);
  animation: card-in 0.36s var(--ease) forwards;

  aspect-ratio: 16 / 9;
}
@keyframes card-in { to { opacity: 1; transform: none; } }

.card__media { width: 100%; height: auto; object-fit: cover; transition: transform 0.6s var(--ease), opacity var(--base) var(--ease); opacity: 0; 
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__media.is-loaded { opacity: 1; }
.card:hover .card__media { transform: scale(1.015); 
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* overlays */
.card__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 38%);
  opacity: 0;
  transition: opacity var(--base) var(--ease);
}
.card:hover .card__overlay, .card:focus-visible .card__overlay { opacity: 1; }

.card__caption {
  position: absolute;
  left: 12px;
  right: 52px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--paper);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease);
}
.card:hover .card__caption, .card:focus-visible .card__caption { opacity: 1; transform: none; }
.card__caption-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; letter-spacing: -0.04px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--avatar-hairline);
}
.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
  border-radius: 9999px;
}

.badge {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  font-size: 13px;
  line-height: 13px;
  color: var(--paper);
}
.badge--glass {
  background: var(--glass);
  box-shadow: var(--ring-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.badge--open { right: 12px; bottom: 12px; opacity: 0; transform: scale(0.9); transition: opacity var(--base) var(--ease), transform var(--base) var(--ease); }
.card:hover .badge--open, .card:focus-visible .badge--open { opacity: 1; transform: none; }
.badge--count { right: 12px; top: 12px; }

.badge--holo {
  right: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  animation: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge--holo svg {
  width: 11px;
  height: 11px;
}
.badge--holo svg path {
  fill: #ffffff;
}
.badge--holo + .badge--count { top: 48px; }
@keyframes holo { from { background-position: 0 0, 0% 50%, 0 0; } to { background-position: 0 0, 200% 50%, 0 0; } }

.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.empty { color: var(--muted); padding: 48px 0; }

/* =========================================================
   SPLIT WORK VIEWER (recent.design item view)
   ========================================================= */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: var(--paper);
  animation: viewer-in var(--base) var(--ease);
}
.viewer[hidden] { display: none; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }

.viewer__topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.viewer__nav-controls { display: flex; gap: 8px; }
.viewer__nav-controls .pill { width: var(--control); padding: 0; }

.viewer__split {
  display: flex;
  align-items: flex-start;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 61px);
}

/* Левая колонка — Паспорт работы */
.viewer__sidebar {
  flex: 0 0 340px;
  width: 340px;
  position: sticky;
  top: 61px;
  padding: 40px 32px 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--hairline);
}

.viewer__author {
  display: flex;
  align-items: center;
  gap: 14px;
}
.viewer__author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.viewer__badge-cat {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.02px;
  line-height: 1.4;
}
.viewer__badge-cat .viewer__cat-title {
  color: var(--muted);
  font-weight: 500;
}
.viewer__badge-cat .viewer__tag-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.viewer__badge-cat .viewer__tag-pill--award {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
  font-weight: 700;
}
.viewer__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 22.4px;
  letter-spacing: -0.04px;
}

.viewer__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.viewer__date {
  font-size: 12px;
  margin-top: -6px;
}

/* Таблица спецификаций */
.viewer__specs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  margin-top: 4px;
  gap: 10px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  line-height: 18.2px;
}
.spec-row__label {
  color: var(--muted);
  font-weight: 400;
}
.spec-row__val {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  letter-spacing: -0.04px;
}
.spec-row__val a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.spec-row__val a:hover {
  opacity: 0.7;
}

.viewer__cta {
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.viewer__cta .pill {
  width: 100%;
}

/* Правая часть — Паспарту с холстом */
.viewer__mat {
  flex: 1 1 auto;
  min-width: 0;
  padding: 48px 48px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.viewer__gallery {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.viewer__gallery figure {
  margin: 0;
  width: 100%;
  background: var(--tile);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.06);
}
.viewer__gallery img,
.viewer__gallery video {
  width: 100%;
  height: auto;
  display: block;
}

body.is-locked { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .viewer__split {
    flex-direction: column;
  }
  .viewer__sidebar {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 24px 20px;
  }
  .viewer__mat {
    padding: 24px 16px 64px;
  }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }

  .sidebar {
    position: sticky;
    z-index: 50;
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    padding: 12px 16px;
    gap: 0;
    border-bottom: 1px solid var(--hairline);
  }
  .sidebar__top > .pill { margin-left: auto; }
  .burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    padding: 0 6px;
  }
  .burger span { display: block; height: 1.3px; background: var(--ink); border-radius: 1px; transition: transform var(--base) var(--ease); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.2px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-3.2px) rotate(-45deg); }

  .nav, .sidebar__bottom { display: none; }
  .sidebar.is-open .nav { display: flex; padding: 24px 0 8px; }
  .sidebar.is-open .sidebar__bottom { display: flex; padding-top: 16px; }

  .main { padding: 16px 12px 40px; }
  .toolbar { gap: 8px; align-items: center; }
  .chips { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; padding-left: 12px; scrollbar-width: none; mask-image: linear-gradient(to right, #000 85%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .titlebar { margin-bottom: 12px; }
  .feed { gap: 8px; }
  .feed__col { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .card { opacity: 1; transform: none; 
  aspect-ratio: 16 / 9;
}
}
/* Custom Case Interactive View */
.custom-case-view {
  width: 100%;
  color: #0b0b0b;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.case-hero {
  position: relative;
  background: radial-gradient(120% 120% at 50% 10%, #151d2a 0%, #080c14 100%);
  border-radius: 12px;
  padding: 56px 44px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0,0,0,0.3);
  margin-bottom: 32px;
}
.case-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0) 70%);
  pointer-events: none;
}
.case-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #00d2ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.case-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: #ffffff;
}
.case-subtitle {
  font-size: 16px;
  color: #8fa0b5;
  max-width: 680px;
  margin: 0 0 32px;
  font-weight: 400;
  line-height: 1.5;
}
.case-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.case-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.case-stat-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.case-stat-num span {
  font-size: 13px;
  color: #00d2ff;
  font-weight: 500;
}
.case-stat-desc {
  font-size: 12px;
  color: #718096;
  line-height: 1.4;
}

.case-section {
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px -5px rgba(0,0,0,0.03);
}
.case-sec-header {
  margin-bottom: 28px;
}
.case-sec-label {
  font-size: 11px;
  font-weight: 600;
  color: #0096c7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.case-sec-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.case-sec-desc {
  font-size: 14px;
  color: #64748b;
  max-width: 640px;
  margin: 0;
}

.tokens-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}
.type-specimen {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
}
.type-big {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #0f172a;
  margin-bottom: 14px;
}
.type-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.type-row:last-child { border: none; }
.type-row-label { color: #64748b; }
.type-row-val { font-weight: 500; color: #0f172a; }

.palette-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.swatch-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}
.swatch-color {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
.swatch-meta { flex: 1; }
.swatch-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1px;
}
.swatch-code {
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}

.charts-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.chart-controls {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}
.chart-tab {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.chart-tab.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.chart-canvas-box {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  min-height: 360px;
}

.sectors-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
.sectors-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sector-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.sector-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sector-btn.is-active {
  background: #00d2ff;
  color: #080c14;
  font-weight: 600;
  border-color: #00d2ff;
}
.sector-display {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sector-display-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.sector-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.sector-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}
.sector-kpi-val {
  font-size: 24px;
  font-weight: 700;
  color: #0096c7;
  line-height: 1.1;
  margin-bottom: 2px;
}
.sector-kpi-label {
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 900px) {
  .case-stats-grid { grid-template-columns: 1fr; }
  .tokens-grid { grid-template-columns: 1fr; }
  .sectors-grid { grid-template-columns: 1fr; }
  .case-section { padding: 20px; }
  .case-hero { padding: 32px 20px; }
  .case-title { font-size: 28px; }
}


/* ---------- 2-row vertical cards (Афиша, Журнал) ---------- */
.feed__col {
  container-type: inline-size;
}
.card.card--vertical {
  aspect-ratio: auto !important;
  height: calc((100cqw * 9 / 16) * 2 + var(--gap)) !important;
}
.card.card--vertical .card__media {
  aspect-ratio: auto !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ---------- Sidebar Subnavigation (Инструменты -> ФотоЛитера) ---------- */
.nav__sub {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  margin: 2px 0 4px 4px;
  border-left: 1px solid var(--hairline);
}
.nav__sublink {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
  transition: color var(--base) var(--ease), background-color var(--base) var(--ease);
}
.nav__sublink:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.03);
}
.nav__sublink.is-active {
  color: var(--ink);
  font-weight: 500;
  background: var(--tile);
}

/* ---------- Standalone Tool Page: ФотоЛитера ---------- */
.app--tool {
  height: 100vh;
  overflow: hidden;
}
.main--tool {
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tool-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--paper);
}

@media (max-width: 860px) {
  .app--tool {
    height: auto;
    overflow: visible;
  }
  .main--tool {
    height: calc(100vh - 56px);
  }
}


/* ==========================================================================
   Clients Section (Swiss Minimalist Logo Grid)
   ========================================================================== */
.clients-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid #e5e7eb;
}
.clients-section__header {
  margin-bottom: 28px;
}
.clients-section__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.clients-section__badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
}
.clients-section__title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0;
}
.clients-section__subtitle {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.client-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.client-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.client-logo-img {
  max-height: 46px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.7);
  transition: filter 0.25s ease, transform 0.25s ease;
}
.client-card:hover .client-logo-img {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .client-card {
    height: 72px;
    padding: 10px 12px;
  }
  .client-logo-img {
    max-height: 38px;
  }
}

/* ==========================================================================
   Contacts Modal
   ========================================================================== */
.contacts-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.contacts-modal[hidden] {
  display: none;
}
.contacts-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.contacts-modal__dialog {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.contacts-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.contacts-modal__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.contacts-modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.contacts-modal__logo {
  border-radius: 50%;
  flex-shrink: 0;
}
.contacts-modal__title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}
.contacts-modal__subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.contacts-modal__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.contacts-modal__card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
}
.contacts-card__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}
.contacts-card__values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contacts-phone-link, .contacts-email-link {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.15s ease;
}
.contacts-phone-link:hover, .contacts-email-link:hover {
  color: #2563eb;
}
.contacts-card__text {
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  margin: 0 0 4px 0;
}
.contacts-card__hint {
  font-size: 12px;
  color: #64748b;
}
.contacts-modal__actions {
  display: flex;
  gap: 10px;
}
.contacts-modal__actions .pill {
  flex: 1;
  text-align: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
}

.client-logo-img--sm {
  max-height: 30px !important;
}

/* ==========================================================================
   Lead Capture Form (Telegram Integration)
   ========================================================================== */
.lead-form {
  margin-bottom: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-sizing: border-box;
}
.lead-form__head {
  margin-bottom: 14px;
}
.lead-form__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.lead-form__subtitle {
  display: block;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.lead-form__project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
}
.lead-form__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.lead-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .lead-form__row {
    grid-template-columns: 1fr;
  }
}
.lead-input, .lead-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.lead-input:focus, .lead-textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.lead-textarea {
  resize: vertical;
  min-height: 56px;
  max-height: 120px;
}
.lead-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.lead-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.lead-form__status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.lead-form__status--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.lead-form__status--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.contacts-modal__divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contacts-modal__divider::before,
.contacts-modal__divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}
.contacts-modal__divider span {
  padding: 0 12px;
}
