/* ============================================================
   КиберПолигон — главная страница
   Раскладка по макету: герой с иллюстрацией, розовая полоса статуса,
   три карточки тренажёров, три пронумерованных факта.
   ============================================================ */

body { background: var(--bg); }

/* ---------------- Шапка ---------------- */

.hub-head {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.hub-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo { width: 44px; height: 44px; display: block; }
.brand__name {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.brand__name b { font-weight: 800; color: var(--red); }
.icon-btn img { display: block; }

@media (min-width: 760px) {
  .hub-head__inner { padding-top: 14px; padding-bottom: 14px; }
  .brand__logo { width: 52px; height: 52px; }
}

/* ---------------- Герой ---------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
  padding-top: 26px;
  padding-bottom: 34px;
}
.hero__title { margin: 14px 0 18px; }
.hero__lead {
  max-width: 46ch;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--body);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero__cta .btn { flex: 1 1 170px; }

.hero__art { order: -1; }               /* на телефоне картинка над текстом */
.hero__art img { display: block; width: 100%; height: auto; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 60px;
  }
  .hero__art { order: 0; }
  .hero__cta .btn { flex: 0 0 auto; min-width: 190px; }
}

/* ---------------- Розовая полоса статуса ---------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: var(--red-soft);
  overflow: hidden;
}
.banner__mascot {
  flex: 0 0 auto;
  width: 74px;
  align-self: center;
  filter: drop-shadow(0 6px 10px rgba(0, 47, 89, .14));
}
.banner__body { flex: 1; min-width: 0; }
.banner__title {
  font-size: clamp(17px, 2.4vw, 20px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.banner__text { color: var(--muted); font-size: clamp(14.5px, 1.8vw, 16px); }
.banner__bar { margin-top: 12px; max-width: 420px; }

.banner__score {
  flex: 0 0 auto;
  text-align: right;
  line-height: 1.05;
  align-self: center;
}
.banner__score b { display: block; font-size: 30px; color: var(--red); font-variant-numeric: tabular-nums; }
.banner__score span { font-size: 12px; color: var(--muted); }

@media (max-width: 560px) {
  .banner { padding: 18px; gap: 12px; }
  .banner__mascot { width: 52px; }
  .banner__score { display: none; }
}

/* ---------------- Секция тренажёров ---------------- */

.sims { padding-top: 54px; scroll-margin-top: 20px; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.sim-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px)  { .sim-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .sim-grid { grid-template-columns: repeat(3, 1fr); } }

.sim-card {
  /* Сетка вместо абсолютного позиционирования: иллюстрация занимает
     собственную колонку, поэтому текст не наезжает на неё ни при какой ширине. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    "chip  art"
    "title art"
    "about about"
    "foot  foot";
  column-gap: 10px;
  padding: 22px 22px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.sim-card:hover {
  transform: translateY(-3px);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.sim-card:active { transform: translateY(0) scale(.995); }

.sim-card__chip {
  grid-area: chip;
  align-self: start;
  justify-self: start;
  background: var(--blue-soft);
}
.sim-card.is-done .sim-card__chip { background: var(--green-soft); color: var(--green); }

.sim-card__title {
  grid-area: title;
  align-self: start;
  margin: 16px 0 10px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.sim-card__about {
  grid-area: about;
  font-size: 15px;
  color: var(--body);
}

.sim-card__art {
  grid-area: art;
  align-self: end;
  justify-self: end;
  width: 100%;
  pointer-events: none;
}
.sim-card__art img { display: block; width: 100%; height: auto; }

.sim-card__foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}
.sim-card__foot svg { flex: 0 0 auto; }
.sim-card__done { color: var(--green); font-weight: 600; }

/* На широкой карточке описание помещается рядом с иллюстрацией */
@media (min-width: 720px) {
  .sim-card {
    grid-template-columns: minmax(0, 1fr) 40%;
    grid-template-areas:
      "chip  art"
      "title art"
      "about art"
      "foot  foot";
  }
}

/* ---------------- Лестница званий ---------------- */

.ranks { padding-top: 54px; }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px)  { .rank-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .rank-grid { grid-template-columns: repeat(5, 1fr); } }

.rank-card {
  position: relative;
  padding: 18px 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 2px solid transparent;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  opacity: .62;
}
.rank-card.is-reached { opacity: 1; background: var(--blue-soft); }
.rank-card.is-current {
  background: #fff;
  border-color: var(--red);
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}
.rank-card__mascot { height: 84px; width: auto; }
.rank-card__name {
  margin-top: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.rank-card__min { font-size: 12.5px; font-weight: 600; color: var(--red); }
.rank-card__tip { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.rank-card__flag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ---------------- Три факта ---------------- */

.facts {
  display: grid;
  gap: 26px;
  margin-top: 44px;
  padding: 30px 26px;
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .facts { grid-template-columns: repeat(3, 1fr); gap: 30px; } }

.fact { display: flex; gap: 16px; align-items: flex-start; }
.fact__badge { width: 50px; height: 47px; flex: 0 0 auto; display: block; }
.fact__title { font-size: 17.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.fact__text { font-size: 15px; color: var(--body); }

/* ---------------- Диплом ---------------- */

.diploma {
  margin-top: 44px;
  padding: 36px 26px;
  border-radius: var(--r-lg);
  text-align: center;
  background: var(--red-soft);
  scroll-margin-top: 20px;
}
.diploma__mascot { height: 120px; width: auto; }
.diploma__eyebrow {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
}
.diploma__title { margin: 8px 0 2px; font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; }
.diploma__name {
  margin: 6px 0 12px;
  font-size: clamp(26px, 4.4vw, 38px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}
.diploma__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 24px;
}
.diploma__stats .chip { background: #fff; }

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

.hub-foot {
  margin-top: 60px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}
.hub-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: calc(26px + var(--safe-bottom));
}
