/* ============================================================
   ССК «ХАСКИ» — БАЗОВЫЕ СТИЛИ И КОМПОНЕНТЫ
   Подключается вторым (после tokens.css).
   Mobile-first, WCAG 2.1 AA, мгновенный отклик на touch-экранах.
   ============================================================ */

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-1);
  background-color: var(--bg-0);
  background-image: var(--glow-hero);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-16);
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }
p  { margin: 0 0 var(--sp-16); }
a  { color: var(--primary); text-decoration: none; touch-action: manipulation; }
a:hover { color: var(--primary-hover); }
ul { margin: 0; padding: 0; list-style: none; }
button, summary, label { touch-action: manipulation; }

/* Списки с фирменным маркером */
.brand-list { list-style: none; padding: 0; margin: 0; }
.brand-list li { position: relative; padding-left: var(--sp-20); margin-bottom: var(--sp-8); }
.brand-list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 12px; height: 3px; border-radius: 2px; background: var(--primary);
}

/* Фокус и skip-link — для клавиатуры */
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--sp-16); top: -64px;
  z-index: 100; padding: var(--sp-12) var(--sp-16);
  background: var(--primary); color: #0B0F17; border-radius: var(--radius-pill);
  font-weight: 700; white-space: nowrap; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-12); }

/* ---------- Шапка (адаптивная без переполнения на планшетах) ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-0);
  background: color-mix(in srgb, var(--bg-0) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-12); min-height: 68px; padding-block: var(--sp-8);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-1); min-width: 0; flex-shrink: 0;
}
.logo:hover { color: var(--text-1); }
.logo__badge {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 20px rgba(35, 194, 222, .28);
}
.logo__text { display: flex; flex-direction: column; min-width: 0; }
.logo__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(15px, 3.8vw, 18px); letter-spacing: .02em; white-space: nowrap;
}
.logo__sub {
  display: block; font-size: 11px; color: var(--text-2);
  font-weight: 500; font-family: var(--font-text);
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
@media (max-width: 359px) {
  .logo__sub { display: none; }
}

.header__actions {
  display: inline-flex; align-items: center; gap: var(--sp-8); flex-shrink: 0;
}
.nav { display: none; }
.nav a {
  color: var(--text-2); font-weight: 500; padding: var(--sp-8) 0;
  position: relative; white-space: nowrap;
}
.nav a:hover { color: var(--text-1); }
.nav a[aria-current="page"] { color: var(--text-1); font-weight: 600; }

.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: var(--radius-pill); border: 1px solid var(--hairline);
  background: var(--bg-1); color: var(--text-1); cursor: pointer; font-size: 18px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease), background var(--dur);
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { transform: scale(.96); }
.burger { display: inline-grid; }

/* ---------- Секции и заголовки ---------- */
.overline {
  font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: var(--sp-12);
}
.section { padding-block: clamp(36px, 6vw, 72px); }
.section__head { max-width: 66ch; margin-bottom: clamp(20px, 3.5vw, 32px); }
.section__lead { color: var(--text-2); font-size: var(--fs-lead); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--tap); min-width: var(--tap);
  padding: 11px 22px;
  border-radius: var(--radius-pill); border: 0; cursor: pointer;
  font-family: var(--font-text); font-weight: 700; font-size: 15px; line-height: 1.25;
  text-align: center;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur), border-color var(--dur);
}
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #0B0F17 !important; }
.btn--primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--glow-primary); }
.theme-light .btn--primary { color: #FFFFFF !important; }
.btn--secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--hairline);
  border: 1.5px solid color-mix(in srgb, var(--primary) 58%, transparent);
}
.btn--secondary:hover { transform: translateY(-1px); border-color: var(--primary); color: var(--primary); }
.btn--ghost { background: transparent; color: var(--primary); font-weight: 600; padding-inline: var(--sp-12); }
.btn--ghost .arrow { transition: transform var(--dur) var(--ease); }
.btn--ghost:hover .arrow { transform: translateX(4px); }
.btn--danger {
  background: transparent; color: var(--error);
  border: 1.5px solid rgba(244, 99, 92, .6);
  border: 1.5px solid color-mix(in srgb, var(--error) 60%, transparent);
}
.btn--plate { background: #0B0F17; color: #FFFFFF !important; }
.btn--plate:hover { opacity: .92; transform: translateY(-1px); }
.header .header__cta { display: none; }

/* ---------- Плитки быстрых действий ---------- */
.tiles { display: grid; gap: var(--sp-12); grid-template-columns: 1fr; }
.tile {
  display: flex; align-items: center; gap: var(--sp-16);
  padding: var(--sp-16) var(--sp-20); border-radius: var(--radius-card);
  background: var(--bg-1); border: 1px solid var(--hairline); color: var(--text-1);
  min-height: 76px;
  transition: transform var(--dur) var(--ease), border-color var(--dur);
}
.tile:hover {
  transform: translateY(-2px); color: var(--text-1);
  border-color: rgba(35, 194, 222, .38);
  border-color: color-mix(in srgb, var(--primary) 38%, transparent);
}
.tile--accent { border-left: 3px solid var(--primary); }
.tile__hint { display: block; color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }

/* ---------- Карточки разделов ---------- */
.cards { display: grid; gap: var(--sp-16); grid-template-columns: 1fr; }
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-8);
  padding: clamp(18px, 3vw, 24px); border-radius: var(--radius-card);
  background: var(--bg-1); border: 1px solid var(--hairline); color: var(--text-1);
  min-width: 0;
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 194, 222, .35);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}
.card__footer {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-8); color: var(--text-2); font-size: var(--fs-small);
}

/* ---------- Бейджи и чипы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  padding: 4px 11px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(35,194,222,.12); color: var(--primary-hover);
  max-width: 100%;
}
.theme-light .badge { background: rgba(15,122,153,.10); color: var(--primary); }
.badge--win { background: rgba(53,196,141,.15); color: var(--success); }
.badge--live { background: rgba(35,194,222,.18); color: var(--primary-hover); }
.badge--live::before { content: "●"; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.badge--uni { background: rgba(123,97,255,.16); color: var(--secondary-soft); }
.badge--warn { background: rgba(239,185,63,.16); color: var(--warning); }

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px;
  padding: 7px 15px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--bg-1); color: var(--text-2);
  font-family: var(--font-text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.chip:hover { color: var(--text-1); border-color: rgba(242,245,249,.18); }
.chip--active { background: var(--primary); color: #0B0F17 !important; border-color: transparent; }
.theme-light .chip--active { color: #FFFFFF !important; }

/* ---------- События (календарная лента) ---------- */
.events { display: grid; gap: var(--sp-12); }
.event {
  display: flex; align-items: center; gap: var(--sp-16);
  padding: var(--sp-16) var(--sp-20); border-radius: var(--radius-card);
  background: var(--bg-1); border: 1px solid var(--hairline);
}
.event__day {
  font-family: var(--font-display); font-weight: 800; font-size: 28px;
  line-height: 1; color: var(--text-1); min-width: 48px; text-align: center; flex-shrink: 0;
}
.event__month { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.event__body { flex: 1 1 auto; min-width: 0; }
.event__body p { margin-bottom: 4px; }
.event__body p:last-child { margin-bottom: 0; }
.event__meta { color: var(--text-2); font-size: var(--fs-small); }

@media (max-width: 559px) {
  .event {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-12);
    padding: var(--sp-16);
  }
  .event__day {
    min-width: 42px;
    font-size: 24px;
    text-align: left;
  }
  .event > .badge {
    margin-left: auto;
  }
}

/* ---------- Таблицы ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
}
table.table { width: 100%; border-collapse: collapse; background: var(--bg-1); }
.table caption { text-align: left; padding: var(--sp-12) var(--sp-16); color: var(--text-2); font-size: var(--fs-small); }
.table th, .table td {
  padding: var(--sp-12) var(--sp-16);
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table thead th {
  background: var(--bg-2);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2); font-weight: 700;
}
.table tbody tr:hover { background: rgba(35,194,222,.05); }
.table .pos { font-family: var(--font-display); font-weight: 800; white-space: nowrap; }

@media (max-width: 479px) {
  .table th, .table td { padding: 10px 12px; font-size: 14px; }
}

/* ---------- Счётчики достижений ---------- */
.stats { display: grid; gap: var(--sp-20); grid-template-columns: 1fr; }
.stat__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--fs-stat); line-height: 1.05; color: var(--text-1);
}
.stat__label { color: var(--text-2); margin-top: var(--sp-8); font-size: 15px; }

/* ---------- CTA-плита и формы ---------- */
.cta {
  position: relative; border-radius: 20px;
  padding: clamp(20px, 4vw, 36px);
  background: var(--grad-banner); color: #0B0F17; overflow: hidden;
}
.cta h2 { color: #0B0F17; }
.cta .steps {
  display: grid; gap: var(--sp-12); grid-template-columns: 1fr;
  margin-block: var(--sp-20); padding: 0; list-style: none;
}
.cta .steps li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.cta .steps b {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: rgba(11,15,23,.14); font-weight: 800; font-family: var(--font-display); font-size: 14px;
}
.cta__note { font-size: var(--fs-small); color: rgba(11,15,23,.82); }
.field { margin-bottom: var(--sp-16); min-width: 0; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--text-2); }
.cta .field label { color: rgba(11,15,23,.78); }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap); padding: 11px 15px;
  border-radius: var(--radius-btn); border: 1px solid var(--hairline);
  background: var(--bg-2); color: var(--text-1);
  font-family: var(--font-text); font-size: 16px; /* >=16px предотвращает авто-зум в iOS Safari */
  transition: border-color var(--dur), box-shadow var(--dur);
}
.cta .input, .cta .select { background: rgba(255,255,255,.90); color: #0B0F17; border-color: transparent; }
.cta .chip { background: rgba(255,255,255,.82); color: #0B0F17; border-color: transparent; }
.cta .chip--active { background: #0B0F17 !important; color: #FFFFFF !important; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 194, 222, .25);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* ---------- Новости ---------- */
.news { display: grid; gap: var(--sp-16); grid-template-columns: 1fr; }
.news-card {
  border-radius: var(--radius-card); overflow: hidden;
  background: var(--bg-1); border: 1px solid var(--hairline);
  color: var(--text-1); display: flex; flex-direction: column;
}
.news-card__img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; background: var(--bg-2); }
.news-card__body { padding: var(--sp-16) var(--sp-20) var(--sp-20); }
.news-card__date { color: var(--text-2); font-size: var(--fs-small); margin-bottom: 6px; }

/* ---------- Футер ---------- */
.footer { border-top: 1px solid var(--hairline); background: var(--bg-1); padding: clamp(32px, 5vw, 48px) 0 var(--sp-32); }
.footer__cols { display: grid; gap: var(--sp-24); grid-template-columns: 1fr; }
.footer__addr { color: var(--text-2); font-size: 14px; margin-bottom: 0; }
.footer__links { display: flex; flex-direction: column; gap: 4px; }
.footer a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 34px; padding: 4px 0; }
.footer a:hover { color: var(--primary-hover); }

/* ---------- Появление секций (progressive: только при активном JS) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .36s var(--ease), transform .36s var(--ease);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Адаптивные контрольные точки ---------- */
@media (min-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cta .steps { grid-template-columns: repeat(3, 1fr); }
  .news { grid-template-columns: repeat(2, 1fr); }
  .footer__cols { grid-template-columns: 1.6fr 1fr 1fr; gap: var(--sp-32); }
}

/* Переход на горизонтальную навигацию на >=960px — исключает обрезание шапки на планшетах 768–959px */
@media (min-width: 960px) {
  .burger { display: none; }
  .nav {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.4vw, 22px);
    font-size: 15px;
    margin-inline: auto;
  }
  .nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    border-radius: 3px; background: var(--grad-bolt);
  }
  .nav__cta {
    color: var(--primary) !important;
    font-weight: 700 !important;
  }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 960px) and (max-width: 1079px) {
  .logo__sub { display: none; }
}

@media (min-width: 1024px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .news { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1140px) {
  .header .header__cta { display: inline-flex; }
  .nav .nav__cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
