/* ============================================================================
   home.css — главная страница рейтинга
   Signature-элемент: полоса-диапазон выручки (.range).
   Источники расходятся в методике подсчёта, поэтому по каждой компании
   в первоисточниках дан диапазон, а не одно число. Полоса рендерит именно
   диапазон — и имеет явное состояние «данных нет» вместо подставленного нуля.
   ========================================================================== */

/* ---------- Hero ----------------------------------------------------------- */

.hero {
  padding-block: 44px 22px;
}

@media (min-width: 1024px) {
  .hero {
    padding-block: var(--section-gap) calc(var(--section-gap) / 2);
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 6px 12px;
  border: 1px solid rgba(157, 202, 255, 0.28);
  border-radius: var(--radius-xs);
  background: rgba(157, 202, 255, 0.06);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1 {
  max-width: 30ch;
  margin-bottom: 24px;
}

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 672px;
}

.hero__intro p {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--on-surface-variant);
}

@media (min-width: 1024px) {
  .hero__intro p {
    font-size: 18px;
    line-height: 28px;
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Полоса доверия ------------------------------------------------- */

.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid rgba(65, 71, 80, 0.3);
  background: rgba(11, 15, 17, 0.5);
}

.trust__cell {
  padding: 32px var(--gutter);
  border-left: 1px solid rgba(65, 71, 80, 0.3);
}

.trust__cell:first-child {
  border-left: 0;
  padding-left: 0;
}

.trust__label {
  display: block;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline);
  margin-bottom: 10px;
}

.trust__value {
  font-family: var(--font-data);
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

@media (min-width: 1024px) {
  .trust__value {
    font-size: 32px;
    line-height: 38px;
  }
}

.trust__note {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 19px;
  color: var(--on-surface-variant);
}

@media (max-width: 780px) {
  .trust {
    grid-template-columns: 1fr;
  }

  .trust__cell {
    border-left: 0;
    border-top: 1px solid rgba(65, 71, 80, 0.3);
    padding-inline: 0;
  }

  .trust__cell:first-child {
    border-top: 0;
  }
}

/* ---------- Таблица рейтинга ----------------------------------------------- */

.rank-table {
  min-width: 940px;
}

.rank-table td.c-rank,
.rank-table th.c-rank {
  width: 62px;
  padding-right: 0;
}

.rank-table .c-rank span {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--outline);
}

.rank-table tbody tr.is-lead .c-rank span {
  color: var(--primary);
}

.rank-table .c-company {
  width: 250px;
}

.company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-cell__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: var(--on-surface);
}

.rank-table .c-spec {
  min-width: 260px;
}

.rank-table .c-type {
  width: 160px;
}

.rank-table .c-revenue {
  width: 260px;
}

/* Подсветка первой строки — воспроизводит .glow-row из Stitch-экспорта */
.rank-table tbody tr.is-lead td {
  background: rgba(66, 73, 91, 0.16);
  box-shadow: inset 0 0 20px rgba(157, 202, 255, 0.07);
}

.rank-table tbody tr.is-lead td:first-child {
  box-shadow: inset 1px 0 0 rgba(157, 202, 255, 0.3),
    inset 0 1px 0 rgba(157, 202, 255, 0.3),
    inset 0 -1px 0 rgba(157, 202, 255, 0.3), inset 0 0 20px rgba(157, 202, 255, 0.07);
}

.rank-table tbody tr.is-lead td:last-child {
  box-shadow: inset -1px 0 0 rgba(157, 202, 255, 0.3),
    inset 0 1px 0 rgba(157, 202, 255, 0.3),
    inset 0 -1px 0 rgba(157, 202, 255, 0.3), inset 0 0 20px rgba(157, 202, 255, 0.07);
}

/* ---------- SIGNATURE: полоса-диапазон ------------------------------------- */

.range {
  display: block;
  min-width: 210px;
}

.range__value {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface);
  margin-bottom: 9px;
  white-space: nowrap;
}

.range__unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--outline);
}

/* Ось: тонкая линия во всю ширину ячейки = шкала 0…80 млрд ₽ */
.range__track {
  display: block;
  position: relative;
  width: 100%;
  height: 14px;
}

.range__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 1px;
  background: rgba(65, 71, 80, 0.9);
}

/* Сегмент между нижней и верхней оценкой источников */
.range__span {
  position: absolute;
  top: 4px;
  left: var(--lo);
  width: var(--span);
  height: 5px;
  background: var(--primary);
  border-radius: 1px;
  opacity: 0.9;
}

/* Засечки на границах диапазона — «скобка» вместо ложно точного столбика */
.range__span::before,
.range__span::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 13px;
  background: var(--primary);
}

.range__span::before {
  left: 0;
}

.range__span::after {
  right: 0;
}

/* Состояние «данных нет» — визуально отличается, не имитирует ноль */
.range--none .range__value {
  color: var(--outline);
}

.range--none .range__track::before {
  background: repeating-linear-gradient(
    to right,
    rgba(65, 71, 80, 0.9) 0 4px,
    transparent 4px 9px
  );
}

.range__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-data);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(139, 145, 155, 0.75);
}

.range-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 14px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--outline);
}

.range-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.range-legend__swatch {
  position: relative;
  width: 34px;
  height: 5px;
  background: var(--primary);
  border-radius: 1px;
}

.range-legend__swatch::before,
.range-legend__swatch::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 13px;
  background: var(--primary);
}

.range-legend__swatch::before {
  left: 0;
}

.range-legend__swatch::after {
  right: 0;
}

.range-legend__swatch--none {
  background: repeating-linear-gradient(
    to right,
    rgba(65, 71, 80, 0.9) 0 4px,
    transparent 4px 9px
  );
  height: 1px;
  margin-block: 2px;
}

.range-legend__swatch--none::before,
.range-legend__swatch--none::after {
  display: none;
}

/* ---------- Карточки компаний ---------------------------------------------- */

.cards {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.company-card {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  padding: 26px;
  background: rgba(25, 28, 31, 0.8);
  border: 1px solid rgba(65, 71, 80, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}

.company-card:hover {
  border-color: rgba(157, 202, 255, 0.45);
}

.company-card:hover .bg-tech {
  opacity: 1;
}

.company-card > *:not(.bg-tech) {
  position: relative;
}

@media (max-width: 900px) {
  .company-card {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.company-card__id {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.company-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.company-card__rank {
  font-family: var(--font-data);
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.company-card h3 {
  font-size: 24px;
  line-height: 32px;
  margin: 0;
}

.company-card__type {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline);
  margin-top: 6px;
}

.company-card__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.company-card__desc {
  margin: 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--on-surface-variant);
  max-width: 74ch;
}

.company-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(65, 71, 80, 0.3);
}

.company-card__meta dt {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--outline);
  margin-bottom: 7px;
}

.company-card__meta dd {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--on-surface-variant);
}

.company-card__meta dd .t-data {
  color: var(--on-surface);
}

/* ---------- Подинтенты: типы игроков --------------------------------------- */

.type-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(157, 202, 255, 0.28);
  border-radius: var(--radius-xs);
  background: rgba(157, 202, 255, 0.06);
  color: var(--primary);
}

.type-card p {
  font-size: 14px;
  line-height: 22px;
  color: var(--on-surface-variant);
  margin: 0;
}

.type-card__example {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(65, 71, 80, 0.3);
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--outline);
}

/* ---------- Подинтенты: классы задач --------------------------------------- */

.class-grid {
  display: grid;
  gap: 1px;
  background: rgba(65, 71, 80, 0.3);
  border: 1px solid rgba(65, 71, 80, 0.3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.class-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: rgba(25, 28, 31, 0.9);
  transition: background-color 0.2s var(--ease);
}

.class-tile:hover {
  background: var(--surface-container-high);
}

.class-tile__head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.class-tile__abbr {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.class-tile__full {
  font-size: 12px;
  line-height: 17px;
  color: var(--outline);
}

.class-tile p {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--on-surface-variant);
}

/* ---------- Матрица выбора подрядчика --------------------------------------- */

.choice-table {
  min-width: 620px;
}

.choice-table td:first-child {
  color: var(--on-surface);
  font-weight: 500;
  width: 38%;
}

.choice-table td:nth-child(2) {
  width: 24%;
}

.choice-table .t-data {
  color: var(--primary);
}

/* ---------- FAQ ------------------------------------------------------------- */

.faq {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(65, 71, 80, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(11, 15, 17, 0.5);
  overflow: hidden;
}

.faq details {
  border-bottom: 1px solid rgba(65, 71, 80, 0.3);
}

.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s var(--ease);
}

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

.faq summary:hover {
  background: rgba(39, 42, 45, 0.6);
}

.faq summary h3 {
  font-size: 17px;
  line-height: 25px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.faq__sign {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  color: var(--primary);
}

.faq__sign::before,
.faq__sign::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.faq__sign::before {
  top: 8px;
  left: 0;
  width: 18px;
  height: 1.5px;
}

.faq__sign::after {
  top: 0;
  left: 8px;
  width: 1.5px;
  height: 18px;
}

.faq details[open] .faq__sign::after {
  transform: scaleY(0);
  opacity: 0;
}

.faq__answer {
  padding: 0 22px 22px 54px;
}

.faq__answer p {
  font-size: 15px;
  line-height: 25px;
  color: var(--on-surface-variant);
  max-width: 82ch;
}

@media (max-width: 640px) {
  .faq__answer {
    padding-left: 22px;
  }
}

/* ---------- Веса методологии ------------------------------------------------ */

.weights {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 1px;
  overflow: hidden;
  gap: 2px;
  margin-block: 18px 14px;
}

.weights span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.weights span:nth-child(1) {
  opacity: 1;
}
.weights span:nth-child(2) {
  opacity: 0.78;
}
.weights span:nth-child(3) {
  opacity: 0.58;
}
.weights span:nth-child(4) {
  opacity: 0.4;
}
.weights span:nth-child(5) {
  opacity: 0.26;
}

.weights-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--on-surface-variant);
}

.weights-key b {
  color: var(--primary);
  font-weight: 700;
}

/* ---------- Блок автора на главной ------------------------------------------ */

.author-strip {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 28px;
  background: rgba(11, 15, 17, 0.7);
  border: 1px solid rgba(65, 71, 80, 0.3);
  border-radius: var(--radius-sm);
}

@media (max-width: 860px) {
  .author-strip {
    grid-template-columns: 96px 1fr;
    gap: 20px;
  }

  .author-strip__cta {
    grid-column: 1 / -1;
  }
}

.author-strip__figure {
  width: 100%;
  aspect-ratio: 1;
}

.author-strip h2 {
  font-size: 22px;
  line-height: 29px;
  margin-bottom: 10px;
}

@media (min-width: 1024px) {
  .author-strip h2 {
    font-size: 26px;
    line-height: 34px;
  }
}

.author-strip p {
  font-size: 14px;
  line-height: 22px;
  color: var(--on-surface-variant);
  max-width: 62ch;
  margin-bottom: 12px;
}

.author-strip__note {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--outline);
}
