/* ===========================================================
   TOP 1000 — рейтинг руководителей
   Дизайн-система по макету Figma «CXO 1000»
   Токены (цвета, типографика, радиусы) сняты с макета через Figma API.
   =========================================================== */

:root {
  /* Основные */
  --blue:        #002AFF;   /* акцент: кнопки, ссылки, крупные числа */
  --blue-deep:   #0021CC;
  --blue-ink:    #4338CA;   /* дальний конец градиента карточки #1 */
  --violet:      #5B4FD6;   /* номера позиций, прогресс, мобильный акцент */
  --violet-soft: #6A5CD6;

  /* Нейтральные */
  --ink:    #16161C;        /* основной текст и тёмный фон */
  --ink-2:  #201E1D;
  --ink-3:  #3A3A44;
  --slate:  #55555F;
  --muted:  #6B6B76;
  --dim:    #8A8A95;

  /* Поверхности */
  --page:    #F5F8FF;       /* фон страницы — светлая лаванда */
  --card:    #FFFFFF;
  --card-2:  #F5F5F7;
  --night:   #12141D;       /* шапка и тёмные секции */
  --night-2: #0B0B12;

  /* Линии */
  --line:   #E0E0E6;
  --line-2: #ECECEF;
  --line-3: #E5E5EA;

  /* Семантика */
  --up:   #2F9E5C;
  --down: #C94A56;
  --gold: #C9822F;

  /* Шрифты. Circe и FindSans Pro — фирменные, их нет в вебе: если установлены
     локально, берём их. Замена для FindSans Pro — Unbounded: «РЫНОК СЛЕДИТ ЗА»
     при 700/64px даёт 804 px против 802 px в макете, то есть метрики сходятся. */
  --f-display: "FindSans Pro", "Unbounded", "Onest", system-ui, sans-serif;
  /* Замена для Circe — Commissioner: из доступных в вебе кириллических
     гротесков он ближе всего по метрикам (отклонение ~4 % против ~8 % у Golos Text) */
  --f-ui:      "Circe", "Commissioner", "Onest", system-ui, sans-serif;
  --f-num:     "Inter", system-ui, sans-serif;
  --f-logo:    "Archivo", "Inter", system-ui, sans-serif;

  /* Радиусы из макета */
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  22px;
  --r-pill: 100px;

  --shell: 1440px;          /* ширина контентной колонки на 1920 */
  --pad: clamp(16px, 3.2vw, 40px);
  --header-h: 76px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}
.icon-fill { font-variation-settings: "FILL" 1, "wght" 400; }

/* Контентная колонка — ровно --shell в ширину: в макете 1440 из 1920,
   то есть от 240 до 1680. Поля добавляются сверх неё, а не внутрь. */
.container {
  width: 100%;
  max-width: calc(var(--shell) + var(--pad) * 2);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

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

/* ============================================================
   Шапка
   ============================================================ */

/* Разделитель рисуем тенью, а не рамкой: рамка добавила бы шапке лишний
   пиксель высоты, и тёмная зона под ней не доезжала бы до верха экрана. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--night);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}
/* На главной и в профиле шапка сливается с тёмным героем */
.site-header.is-transparent {
  background: transparent;
  box-shadow: none;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-transparent.is-stuck {
  background: rgba(18, 20, 29, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-inner {
  position: relative;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-family: var(--f-logo);
  font-weight: 800;
  font-size: 19px;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: pre-line;
  flex: 0 0 auto;
}

/* Навигация-«таблетка». В макете: светлая полупрозрачная подложка со светлой
   обводкой, все пункты одинаковые — активный ничем не выделен. */
.nav-pill {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Боковые поля таблетки в макете — 56 px до первого пункта */
  padding: 5px 26px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: rgba(233, 236, 243, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}
.nav-pill a {
  display: flex;
  align-items: center;
  height: 45px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-family: var(--f-ui);
  font-weight: 400;
  font-size: 20px;
  color: #3D4250;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-pill a:hover { background: rgba(255, 255, 255, 0.55); color: var(--ink); }

/* Специфичность выше .btn — иначе inline-flex у кнопки перебивает скрытие */
.site-header .header-cta { display: none; margin-left: auto; }

.icon-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.on-light { color: var(--ink); }
.icon-btn.on-light:hover { background: rgba(0, 0, 0, 0.06); }

.btn-menu { margin-left: auto; }

/* ============================================================
   Кнопки
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }

.btn-white { background: #EEF2FF; color: var(--blue); }
.btn-white:hover { background: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--card-2); }

.btn-violet { background: var(--violet); color: #fff; }
.btn-violet:hover { background: #4f43c4; }

.btn-sm { height: 42px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================
   Типографика секций
   ============================================================ */

.kicker {
  margin: 0 0 6px;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}
.kicker.on-dark { color: rgba(255, 255, 255, 0.62); }
.kicker.neutral { color: #555D71; }

/* В макете 36 px на 1280 и 40 px на 1920 — шаг небольшой, задаём двумя ступенями */
.section-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(19px, 8px + 2.2vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #182035;
}
.section-title .accent { color: var(--blue); }

.section { padding: clamp(36px, 5vw, 72px) 0; }

/* ============================================================
   Hero
   ============================================================ */

/* Тёмная зона: общий фон под hero и блоком Топ-3.
   В макете фоновая картинка прижата к низу тёмной области (y 399..962 из 940),
   сверху — голубой луч из двух угловых градиентов. */
.dark-zone {
  position: relative;
  /* Заходит под шапку — она полупрозрачная и лежит на этом фоне */
  margin-top: calc(var(--header-h) * -1);
  background: var(--night);      /* в макете основа тёмной зоны — #12141D */
  isolation: isolate;
  overflow: hidden;      /* 3D-объекты не выходят за тёмную зону */
}
/* Только луч сверху: зарево внизу рисует .hero-glow, иначе затемнение съедало его */
.dark-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(115% 40% at 50% -6%,
      rgba(60, 120, 255, 0.42) 0%, rgba(60, 120, 255, 0.09) 46%, transparent 72%),
    linear-gradient(180deg, rgba(2, 0, 17, 0.55) 0%, rgba(2, 0, 17, 0) 38%);
}

/* Фоновая картинка из макета. На широком экране она наполовину свисает
   ниже hero и гасится светлой полкой блока Топ-3 — как в макете (y 399..962). */
.hero-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82%;
  z-index: 0;
  pointer-events: none;
  /* screen: чёрный фон картинки не влияет на основу, светится только зарево */
  mix-blend-mode: screen;
  background: url("assets/hero-bg.webp") center / 100% 100% no-repeat;
}
/* На узком экране блок Топ-3 светлый и закрывает фон собой.
   У .hero намеренно нет z-index: иначе он создаёт контекст наложения
   и mix-blend-mode у зарева перестаёт видеть фон под ним. */
.dark-zone > .hero { position: relative; background: transparent; }
.dark-zone > .top3-section { position: relative; z-index: 1; }

/* Отступы сняты с макета 1920: шапка 84 + 98 сверху, 62 снизу до блока Топ-3 */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(62px, 5.4vw, 78px)) 0 clamp(58px, 3.4vw, 62px);
}

/* Фон тёмной шапки профиля (там своя, более короткая зона) */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("assets/hero-bg.webp") center bottom / 100% 74% no-repeat;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero .eyebrow {
  margin: 0 0 14px;
  font-family: var(--f-num);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  /* В макете 64 px и на 1280, и на 1920 — растём только до 1280 */
  font-size: clamp(32px, 18.8px + 3.53vw, 64px);
  line-height: 1.18;          /* в макете блок из двух строк — 163 px при кегле 64 */
  letter-spacing: -0.015em;
  color: #fff;
  text-transform: uppercase;
}
/* На узком экране заголовок переносится сам — принудительный разрыв только на широком */
.br-wide { display: none; }

.hero-lead {
  margin: clamp(16px, 2vw, 26px) 0 0;
  max-width: 560px;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

/* 3D-объекты из макета. На узком экране уводим их из-под текста. */
.hero-art {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
/* Обе фигуры крепим за центр: поворот трансформацией не сдвигает раскладку.
   Числа — из мобильного макета (кадр 373): хештег центр (34, 534),
   «1000» центр (299, 244) при высоте тёмной зоны 534. */
.hero-art.hash {
  left: 9.1%;
  top: 100%;
  width: 32.2%;
  aspect-ratio: 362 / 340;
  transform: translate(-50%, -50%);
}
.hero-art.num {
  left: 80.2%;
  top: 45.7%;
  width: 32.1%;
  aspect-ratio: 470 / 242;
  transform: translate(-50%, -50%) rotate(-32.87deg);
}

/* Поиск */
.search-row {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: clamp(22px, 3vw, 34px) 0 0;
  max-width: 620px;
}
.search-row .btn { width: 100%; }
.search-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: #E8E8EC;
  color: var(--ink-2);
}
.search-field .material-symbols-outlined { color: #5c5c66; font-size: 20px; }
.search-field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
}
.search-field input::placeholder { color: #6f6f79; }
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-clear {
  display: none;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-2);
  cursor: pointer;
  place-items: center;
}
.search-clear.is-visible { display: grid; }

/* ============================================================
   Топ-3
   ============================================================ */

.top3-section {
  position: relative;
  padding: clamp(26px, 3vw, 50px) 0 clamp(32px, 5vw, 80px);
  background: var(--page);
}
.top3-section > .container { position: relative; z-index: 1; }

.top3-head {
  margin: 0 0 14px;
  font-family: var(--f-display);
  font-weight: 700;
  /* 40 px и на 1280, и на 1920; 16 px на мобильном */
  font-size: clamp(16px, 6.1px + 2.65vw, 40px);
  line-height: 1;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.top3 {
  display: grid;
  gap: clamp(12px, 1.4vw, 20px);
  align-items: center;
}
/* На узком экране лидер идёт первым */
.top3-card.is-first { order: -1; }

.top3-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 1.4vw, 24px);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(15, 20, 60, 0.06);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}
.top3-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15, 20, 60, 0.12); }
.top3-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.top3-card.is-first {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-ink) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 42, 255, 0.34);
}

.top3-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(18px, 2.6vw, 49px);   /* в макете 49 px между номером и именем */
}
.top3-rank {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: clamp(24px, 14px + 1.56vw, 34px);
  line-height: 1;
  color: var(--violet);
}
.top3-card.is-first .top3-rank { font-size: clamp(30px, 16px + 2.5vw, 48px); color: #fff; }
.top3-card.is-bronze .top3-rank { color: var(--gold); }

.top3-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(16px, 8px + 0.94vw, 20px);
  line-height: 1.16;
  color: var(--ink);
}
.top3-card.is-first .top3-name { font-size: clamp(20px, 12px + 1.88vw, 36px); color: #fff; }

.top3-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--dim);
}
.top3-card.is-first .top3-sub { color: rgba(255, 255, 255, 0.8); }

.top3-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(16px, 1.8vw, 32px);       /* в макете 32 px до разделителя */
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.top3-card.is-first .top3-foot { border-top-color: rgba(255, 255, 255, 0.28); }
.top3-foot .label {
  font-family: var(--f-num);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.top3-card.is-first .top3-foot .label { color: rgba(255, 255, 255, 0.75); }
.top3-score {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1;
  color: var(--ink);
}
.top3-card.is-first .top3-score { color: #fff; }

/* Значок динамики */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  font-family: var(--f-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.delta .material-symbols-outlined { font-size: 13px; }
.delta.up   { color: var(--up); }
.delta.down { color: var(--down); }
.top3-card.is-first .delta { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ============================================================
   Чипы отраслей
   ============================================================ */

.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 6px;
  margin: 0 calc(var(--pad) * -1) 12px;
  padding-left: var(--pad);
  padding-right: var(--pad);
  scroll-snap-type: x proximity;
}
.chip {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-3);
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.chip:hover { border-color: #c9c9d4; }
.chip:active { transform: scale(0.97); }
.chip.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Снимаемые теги активных фильтров */
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tagrow:empty { display: none; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.filter-tag:hover { color: var(--ink); border-color: #c9c9d4; }
.filter-tag .material-symbols-outlined { font-size: 15px; }

/* ============================================================
   Список рейтинга — таблица
   ============================================================ */

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 4px;
}
.result-count {
  font-family: var(--f-num);
  font-size: 13px;
  color: var(--muted);
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border: 0;
  background: none;
  font-family: var(--f-num);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn .material-symbols-outlined { font-size: 17px; }

.rank-list { display: flex; flex-direction: column; }

.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-areas:
    "num name score"
    "num name delta";
  align-items: center;
  column-gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-3);
  cursor: pointer;
  transition: background 0.14s ease;
}
.rank-row:hover { background: rgba(91, 79, 214, 0.045); }
.rank-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.rank-num {
  grid-area: num;
  align-self: center;
  font-family: var(--f-num);
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}
.rank-row.is-leader .rank-num { color: var(--violet); }

.rank-name-cell {
  grid-area: name;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-name {
  min-width: 0;
  font-family: var(--f-num);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-sub {
  min-width: 0;
  font-family: var(--f-num);
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  grid-area: score;
  justify-self: end;
  align-self: end;
  font-family: var(--f-num);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
}
.rank-delta {
  grid-area: delta;
  justify-self: end;
  align-self: start;
  font-family: var(--f-num);
  font-size: 11px;
  color: var(--dim);
}
.rank-delta.up   { color: var(--up); }
.rank-delta.down { color: var(--down); }

/* Колонки, которые появляются только на широком экране */
.rank-sector, .rank-likes { display: none; }

.rank-likes {
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 4px 6px;
  border-radius: var(--r-pill);
  font-family: "Arial", var(--f-num);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.rank-likes:hover { background: rgba(201, 74, 86, 0.08); }
.rank-likes .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.rank-likes.is-liked, .rank-likes.is-liked .material-symbols-outlined { color: var(--down); }

/* Пустой результат */
.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 0;
  text-align: center;
}
.empty.is-visible { display: flex; }
.empty .material-symbols-outlined { font-size: 40px; color: var(--dim); }
.empty p { color: var(--muted); }

/* Пагинация */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(22px, 3vw, 42px);
}
.pager button {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font-family: var(--f-num);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.pager button:hover:not(:disabled) { border-color: var(--violet); color: var(--violet); }
.pager button.is-current {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .gap {
  min-width: 20px;
  color: var(--dim);
  font-family: var(--f-num);
  font-size: 14px;
  text-align: center;
}
.pager .material-symbols-outlined { font-size: 18px; }

/* ============================================================
   Блок заявки
   ============================================================ */

/* Нижний отступ секции учитывает «1000», свисающую за край блока */
.cta-section { padding: clamp(8px, 2vw, 28px) 0 clamp(60px, 8vw, 120px); }

.cta {
  position: relative;
  /* overflow не режем: 3D-объект должен выходить за нижнюю границу */
  border-radius: var(--r-md);
  background: var(--blue);
  color: #fff;
  /* В макете блок идёт от края до края кадра; оставляем минимальный отступ,
     чтобы скругление 14 px было видно */
  margin: 0 clamp(10px, 1.2vw, 24px);
  padding: clamp(30px, 4.5vw, 64px) 0;
}
.cta-inner { position: relative; z-index: 1; }

.cta-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(32px, 12px + 2.8vw, 48px);
  line-height: 1.08;
  max-width: 12ch;   /* перенос в три строки только на узком экране */
}
.cta-lead {
  margin-top: 12px;
  max-width: 46ch;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.4;
  color: #fff;
}
.cta-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: clamp(24px, 3vw, 40px);
}
.cta-form .pair { display: grid; gap: 12px; }
.cta-form input {
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-pill);
  background: #EEF2FF;
  font-family: "Manrope", var(--f-ui);
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.cta-form input::placeholder { color: #7F7F8B; }
.cta-form input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5); }

/* На узком экране 3D-объекта в блоке заявки нет — как в мобильном макете */
.cta-art { display: none; }

.cta-done {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-weight: 600;
}
.cta-done.is-visible { display: flex; }

/* ============================================================
   Как считается рейтинг
   ============================================================ */

.method-title {
  text-align: center;
  margin-bottom: clamp(24px, 3vw, 46px);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(20px, 9px + 2.2vw, 36px);
  color: var(--ink);
}
.method-grid { display: grid; gap: clamp(14px, 1.6vw, 30px); }

/* На узком экране заголовок над текстом, на широком — две колонки */
.method-card {
  display: grid;
  gap: 12px;
  padding: clamp(20px, 2vw, 30px) clamp(18px, 1.6vw, 26px);
  background: var(--card-2);
  border-bottom: 2px solid var(--violet);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.method-card h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 20px;          /* в макете 20 px вплоть до 1280 */
  line-height: 1.15;
  color: var(--ink);
}
.method-card p {
  font-size: 16px;          /* в макете 16 px на всех кадрах */
  line-height: 1.55;
  color: var(--slate);
}

/* ============================================================
   Подвал
   ============================================================ */

.site-footer {
  padding: clamp(24px, 3vw, 40px) 0 clamp(28px, 3vw, 44px);
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  font-family: var(--f-num);
  font-size: 13px;
  color: #7A7A85;
}

/* ============================================================
   Боковое меню (мобильное)
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 6, 14, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: min(84vw, 320px);
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--night);
  color: #fff;
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.22, 0.7, 0.3, 1);
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  font-family: var(--f-ui);
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.drawer-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.drawer-item .material-symbols-outlined { font-size: 21px; color: rgba(255, 255, 255, 0.55); }
.drawer-item .count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--violet);
  font-family: var(--f-num);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.drawer-foot { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.drawer-foot .btn { width: 100%; }
.drawer-version {
  margin-top: 14px;
  font-family: var(--f-num);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
}

/* ============================================================
   Модалка «Методология»
   ============================================================ */

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-wrap.is-open { display: grid; }
.modal-wrap > .overlay { z-index: 0; }
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: 84vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: 0 30px 80px rgba(10, 12, 40, 0.32);
}
.modal-dialog h2 {
  margin-bottom: 14px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 26px;
}
.modal-dialog p { margin-bottom: 12px; color: var(--slate); font-size: 15px; line-height: 1.6; }
.modal-close { position: absolute; top: 12px; right: 12px; }

/* ============================================================
   Тост
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translate(-50%, 14px);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Профиль
   ============================================================ */

.profile-hero {
  position: relative;
  margin-top: calc(var(--header-h) * -1);
  padding: calc(var(--header-h) + 24px) 0 0;
  background: var(--night-2);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
}
.profile-hero .hero-bg { background-position: center 30%; }
.profile-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(2, 0, 17, 0.80) 0%,
    rgba(23, 31, 65, 0.55) 45%,
    rgba(43, 30, 130, 0.55) 78%,
    rgba(60, 40, 170, 0.62) 100%);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: clamp(16px, 2vw, 30px);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.back-link .material-symbols-outlined { font-size: 20px; }
.back-link:hover { opacity: 0.82; }

.profile-tags { display: flex; gap: 8px; margin-bottom: 16px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  font-family: var(--f-num);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tag-chip.solid { background: var(--violet); color: #fff; font-weight: 700; }

.profile-id {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px clamp(14px, 2vw, 34px);
  margin-bottom: clamp(18px, 2vw, 28px);
}
.profile-idtext { min-width: 0; }
/* На узком экране бейджи уходят под аватар и имя */
.badge-row { grid-column: 1 / -1; }
.profile-photo {
  flex: 0 0 auto;
  width: clamp(76px, 9vw, 168px);
  height: clamp(76px, 9vw, 190px);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(150deg, #2b3350, #171c30);
  display: grid;
  place-items: center;
  font-family: var(--f-num);
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 34px);
  color: var(--violet);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(22px, 18.8px + 3.53vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.profile-role {
  margin-top: 6px;
  font-family: var(--f-num);
  font-size: clamp(13px, 6px + 2.05vw, 32px);
  color: #EAEAEA;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: #fff;
  font-family: var(--f-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.badge.blue  { background: var(--blue); color: #fff; font-weight: 700; }
.badge.up    { background: #E2F3E9; color: var(--up); }
.badge.down  { background: #FBE6E8; color: var(--down); }
.badge.gold  { background: #FAE9D6; color: var(--gold); }

.profile-actions { display: flex; gap: 10px; margin-top: clamp(16px, 2vw, 24px); }
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--card);
  font-family: "Arial", var(--f-num);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
}
.act-btn:active { transform: scale(0.97); }
.act-btn .material-symbols-outlined { font-size: 18px; }
.act-btn.share { background: var(--blue); color: #fff; font-family: var(--f-ui); }
.act-btn.share:hover { background: var(--blue-deep); }
.act-btn.is-liked { color: var(--down); }
.act-btn.is-liked .material-symbols-outlined { color: var(--down); }

/* Карточка интегрального индекса */
.index-card {
  margin-top: clamp(22px, 3vw, 40px);
  padding: clamp(18px, 2vw, 30px);
  border-radius: var(--r-sm);
  background: var(--card-2);
  text-align: center;
}
.index-card .label {
  font-size: clamp(11px, 1vw, 16px);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.index-card .value {
  margin-top: 6px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(34px, 3vw, 46px);
  line-height: 1;
  color: var(--blue);
}
.index-card .value small {
  font-size: clamp(14px, 1.1vw, 18px);
  color: var(--dim);
  font-weight: 700;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding-bottom: clamp(28px, 4vw, 56px);
}
.fact {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--card-2);
}
.fact .label {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fact .val {
  margin-top: 3px;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

/* Бустеры. На узком экране — горизонтальная лента, как в макете. */
.booster-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin: 0 calc(var(--pad) * -1);
  padding: 2px var(--pad) 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.booster-grid::-webkit-scrollbar { display: none; }
.booster {
  flex: 0 0 auto;
  width: min(74vw, 260px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-2);
  scroll-snap-align: start;
}
.booster.is-locked { opacity: 0.62; }
.medal {
  flex: 0 0 auto;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(160deg, var(--m1), var(--m2));
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.14), inset 0 6px 10px rgba(255, 255, 255, 0.28);
}
.medal.violet { --m1: #9B8FF5; --m2: #6A5CD6; }
.medal.green  { --m1: #5FB37F; --m2: #2F9E5C; }
.medal.gold   { --m1: #E0A565; --m2: #C9822F; }
.medal.grey   { --m1: #E2E2E6; --m2: #C9C9D1; color: #8A8A95; }
.medal .material-symbols-outlined { font-size: 26px; }

.booster-body { min-width: 0; }
.booster-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: #232329;
}
.booster-meta {
  margin-top: 4px;
  font-family: var(--f-num);
  font-size: 12px;
  color: var(--violet-soft);
}
.booster-state {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--dim);
}
.booster-state.violet { color: var(--violet-soft); }
.booster-state.green  { color: var(--up); }
.booster-state.gold   { color: #E0A565; }

/* Панель компетенций */
.skills-panel {
  display: grid;
  gap: clamp(22px, 3vw, 40px);
  padding: clamp(22px, 2.6vw, 44px);
  border-radius: var(--r-lg);
  background: var(--blue);
  color: #fff;
}
.metric-list { display: flex; flex-direction: column; gap: 16px; }
.metric-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.metric-name {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: clamp(15px, 1.3vw, 20px);
  color: #fff;
}
.metric-val {
  font-family: var(--f-num);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  padding: 1px 8px;
  border-radius: 6px;
}
.metric-note {
  margin-top: 5px;
  font-family: var(--f-num);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
}
.progress {
  height: 4px;
  margin-top: 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform-origin: left;
  animation: bar-in 0.7s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
@keyframes bar-in { from { transform: scaleX(0); } }

.radar-wrap { display: grid; place-items: center; padding: 4px 0; }
.radar { width: min(100%, 420px); height: auto; overflow: visible; }

/* Панели профиля */
.panel {
  padding: clamp(18px, 2vw, 28px);
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-2);
}
.panel-title {
  margin-bottom: 12px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(17px, 1.5vw, 20px);
  color: var(--ink);
}
.panel p { color: var(--ink-3); font-size: 15px; line-height: 1.55; }
.panel p + p { margin-top: 12px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--ink-3); font-size: 15px; line-height: 1.55; }
.panel li + li { margin-top: 6px; }

.section-head {
  margin-bottom: clamp(14px, 1.6vw, 22px);
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(17px, 1.7vw, 24px);
  color: var(--ink);
}

/* График истории */
.chart-card {
  padding: clamp(16px, 2vw, 26px);
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-2);
}
.chart-wrap { position: relative; height: clamp(150px, 18vw, 230px); }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--f-num);
  font-size: 11px;
  color: var(--dim);
}

/* ============================================================
   Планшет
   ============================================================ */

@media (min-width: 760px) {
  :root { --header-h: 84px; }

  .brand { font-size: 24px; }

  /* Тёмная полоса продолжает hero: заголовок и верх карточек лежат на ней.
     Сам фон рисует .dark-bg, поэтому секция становится прозрачной. */
  .dark-zone > .top3-section { background: transparent; }
  .top3-section { margin-top: -1px; }
  .top3-section::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 47%;
    background: var(--page);
    z-index: 0;
  }
  /* В макете карточка лидера начинается сразу под заголовком */
  .top3-head { text-align: center; color: #fff; margin-bottom: 6px; }

  /* В макете все три карточки выровнены по нижнему краю (y=1086),
     а лидер просто выше остальных на 73 px и уходит вверх, на тёмную полосу. */
  .top3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    max-width: 1216px;      /* ряд ýже контейнера: в макете 1212 из 1440 */
    margin: 0 auto;
    gap: 20px;
  }
  .top3-card.is-first { order: 0; padding-top: calc(clamp(18px, 1.4vw, 24px) + 14px); }


  .cta-title { max-width: none; }
  .cta-form { max-width: clamp(400px, 49%, 720px); }
  .cta-form .pair { grid-template-columns: 1fr 1fr; }

  /* «1000» свисает за нижний край блока. Пропорции сняты с макета 1920:
     ширина 26,8 % блока, отступ справа 17,4 %, вынос вниз 18 % высоты. */
  .cta-art {
    display: block;
    position: absolute;
    z-index: 0;
    right: 17.4%;
    bottom: -18%;
    width: clamp(200px, 26.8%, 530px);
    pointer-events: none;
    user-select: none;
  }

  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }

  .fact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .booster-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .booster { min-width: 0; width: auto; }   /* сбрасываем ширину ленты */

  .profile-actions { margin-top: 20px; }
  .profile-photo { border-radius: var(--r-md); }
  .badge-row { grid-column: 2; margin-top: 4px; }

  /* В макете 1920 картинка занимает y 399..962 при hero 0..655 */
  .hero-glow { bottom: -47%; height: 86%; }

  .br-wide { display: inline; }
  .search-row { flex-direction: row; }
  .search-row .btn { width: auto; flex: 0 0 auto; }
  .hero-inner { text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .search-row { margin-left: auto; margin-right: auto; }

  /* Границы 3D-объектов сняты с рендера макета 1920.
     Figma растягивает картинки (scaleMode STRETCH), поэтому задаём
     соотношение сторон явно — object-fit по умолчанию как раз fill. */
  /* Центр видимого хештега в макете 1920 — (344, 312) */
  .hero-art.hash {
    left: 17.9%; top: 47.3%;
    width: 18.85%; aspect-ratio: 362 / 340;
    transform: translate(-50%, -50%);
  }
  /* Центр повёрнутого «1000» в макете — (1528, 428) при кадре 1920 и высоте hero 660 */
  .hero-art.num {
    left: 79.6%; top: 64.8%; right: auto; bottom: auto;
    width: 24.48%; aspect-ratio: 470 / 242;
    transform: translate(-50%, -50%) rotate(-32.87deg);
  }

  /* Таблица рейтинга получает полный набор колонок */
  .rank-row {
    grid-template-columns: 62px minmax(0, 1.9fr) 96px minmax(0, 1fr) 108px 64px;
    grid-template-areas: "num name score sector likes delta";
    column-gap: 16px;
    padding: 15px 0;
  }
  .rank-num { font-family: var(--f-ui); font-weight: 800; font-size: 20px; }
  .rank-name {
    font-family: var(--f-ui);
    font-weight: 700;
    font-size: 20px;
  }
  .rank-sub {
    font-family: var(--f-ui);
    font-size: 12.5px;
    color: var(--muted);
  }
  .rank-score { justify-self: start; align-self: center; font-size: 16px; }
  .rank-sector {
    display: block;
    font-family: var(--f-ui);
    font-size: 16px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rank-likes { display: inline-flex; justify-self: start; align-self: center; }
  .rank-delta { font-family: var(--f-ui); font-size: 16px; align-self: center; }
}

/* ============================================================
   Десктоп
   ============================================================ */

@media (min-width: 1080px) {
  :root { --header-h: 104px; }
  .brand { font-size: 36px; }

  .nav-pill { display: flex; }
  .btn-menu { display: none; }

  /* Кнопка шапки: в макете 260×53, текст Circe 700 24px цветом #201E1D */
  .site-header .header-cta {
    display: inline-flex;
    height: 53px;
    padding: 0 45px;      /* в макете кнопка 260×53 при ширине текста 169 */
    font-family: var(--f-ui);
    font-weight: 700;
    font-size: 24px;
    color: #201E1D;
  }
  .site-header .header-cta:hover { background: #1a3bff; color: #201E1D; }

  /* Все отрасли помещаются в строку — без горизонтальной прокрутки */
  .chips {
    flex-wrap: wrap;
    overflow: visible;
    margin: 0 0 12px;
    padding: 4px 0 6px;
  }

  .hero-inner { padding: clamp(20px, 3vw, 46px) 0 0; }
  .search-row { max-width: 660px; }

  .skills-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; }

  .profile-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
}


/* ============================================================
   Широкий десктоп: в макете часть заголовков подрастает
   с 1280 к 1920 (36→40, 20→24), остальные остаются как есть
   ============================================================ */

/* Три карточки в ряд — только когда каждой хватает ширины */
@media (min-width: 900px) {
  .method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Две колонки внутри карточки (как в макете) — когда карточка ~380 px и шире.
   min-content у первой колонки не даёт длинному слову «Обновление»
   вылезти на текст соседней колонки. */
@media (min-width: 1200px) {
  .method-card {
    grid-template-columns: minmax(min-content, 0.85fr) minmax(0, 1.4fr);
    align-items: center;
    gap: clamp(16px, 2vw, 34px);
    padding-left: clamp(20px, 2.2vw, 38px);
    padding-right: clamp(14px, 1.4vw, 24px);
  }
}

@media (min-width: 1280px) {
  .section-title,
  .method-title { font-size: clamp(36px, 28px + 0.625vw, 40px); }
  .method-card h3 { font-size: clamp(20px, 12px + 0.625vw, 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
   Поделиться профилем: обложка для сторис и постов
   ============================================================ */

.share-wrap {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  place-items: center;
  padding: 20px;
}
.share-wrap.is-open { display: grid; }
.share-wrap > .overlay { z-index: 0; background: rgba(6, 6, 14, 0.66); }

.share-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: 0 30px 90px rgba(10, 12, 40, 0.42);
  animation: share-in 0.24s ease both;
}
@keyframes share-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.share-close { position: absolute; top: 12px; right: 12px; }
.share-head { margin-bottom: 18px; }
.share-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
}

.share-body {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
}

/* Сцена превью: тёмная подложка, чтобы обложка «висела» как в редакторе */
.share-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 22px);
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(91, 79, 214, 0.28), transparent 70%),
    var(--night-2);
  min-height: 260px;
}
.share-preview { display: grid; place-items: center; width: 100%; }
.share-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 520px);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.share-wrap.is-busy .share-stage::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  animation: share-spin 0.7s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }

.share-side { display: grid; align-content: start; gap: 18px; }

/* Переключатель форматов */
.share-formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.share-fmt {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.share-fmt:hover { background: var(--card-2); }
.share-fmt:active { transform: scale(0.98); }
.share-fmt.is-active { border-color: var(--blue); background: #EEF2FF; }
.share-fmt-box {
  width: 22px;
  border-radius: 4px;
  border: 2px solid var(--dim);
  transition: border-color 0.18s ease;
}
.share-fmt-box.is-story  { height: 34px; }
.share-fmt-box.is-post   { height: 27px; }
.share-fmt-box.is-square { height: 22px; }
.share-fmt.is-active .share-fmt-box { border-color: var(--blue); }
.share-fmt-name {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.share-fmt-ratio {
  font-family: var(--f-num);
  font-size: 11px;
  color: var(--muted);
}
.share-fmt.is-active .share-fmt-ratio { color: var(--blue); }

.share-actions { display: grid; gap: 10px; }
.share-actions .btn { font-size: 16px; }
.share-actions .material-symbols-outlined { font-size: 20px; }

.share-hint {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* На широком экране превью и управление стоят рядом */
@media (min-width: 760px) {
  .share-body { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .share-canvas { max-height: min(64vh, 640px); }
}

/* На телефоне это шторка снизу */
@media (max-width: 600px) {
  .share-wrap { padding: 0; place-items: end stretch; }
  .share-sheet {
    width: 100%;
    max-height: 94vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    animation: share-up 0.26s ease both;
  }
  @keyframes share-up {
    from { transform: translateY(100%); }
    to   { transform: none; }
  }
  .share-canvas { max-height: 42vh; }
  .share-stage { min-height: 200px; }
}
