* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1116;
  --bg-alt: #0d0f14;
  --panel: #171a21;
  --panel-2: #1e2330;
  --border: #262b36;
  --border-hi: #3a4051;
  --text: #e6e8ee;
  --text-dim: #b8c0d0;
  --muted: #8b93a7;
  --muted-2: #6a7285;
  --accent: #6aa9ff;
  --accent-hi: #4d8ef7;
  --ok: #4ade80;
  --err: #fca5a5;
  --warn: #ffd866;
  --mono: 'SF Mono', 'Monaco', 'Consolas', 'Menlo', monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 17, 22, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo-mark {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-hi), #7b5cff);
  color: #fff; font-weight: 700; font-size: 18px;
  border-radius: 10px; box-shadow: 0 4px 14px rgba(77, 142, 247, 0.3);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.logo-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px; font-size: 14px; color: var(--muted);
  text-decoration: none; border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--accent); background: rgba(106, 169, 255, 0.1); }

.burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ===== HERO ===== */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0 auto; }

/* ===== SECTIONS ===== */
section { padding: 20px 0 60px; }
.section-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ===== CLASS GRID ===== */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.class-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 22px 20px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.class-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(106, 169, 255, 0.12), transparent 60%);
  opacity: 0; transition: opacity .25s;
}
.class-card:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.class-card:hover::before { opacity: 1; }
.class-card--accent {
  border-color: rgba(106, 169, 255, 0.4);
  background: linear-gradient(160deg, rgba(106, 169, 255, 0.08), var(--panel));
}
.badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; background: var(--accent-hi); color: #fff;
  border-radius: 99px; text-transform: uppercase;
}
.class-num {
  font-size: 38px; font-weight: 800; letter-spacing: -0.04em;
  color: var(--accent); line-height: 1;
  display: flex; align-items: baseline; gap: 8px;
}
.class-num small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.class-name { font-size: 14px; color: var(--muted); margin-top: 2px; }
.class-more {
  margin-top: 10px; font-size: 13px; font-weight: 500;
  color: var(--accent); opacity: 0; transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.class-card:hover .class-more { opacity: 1; transform: none; }

/* ===== FOOTER ===== */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 40px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}

/* ===== TO TOP ===== */
.to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s, background .2s; z-index: 90;
}
.to-top.visible { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--panel-2); transform: translateY(-2px); }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== PAGE HEAD ===== */
.page-head { padding: 48px 0 20px; }
.page-head h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 15px; max-width: 720px; }
.breadcrumbs { font-size: 13px; color: var(--muted-2); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; }

/* ===== TOPIC LIST ===== */
.topic-list { display: grid; gap: 14px; }
.topic-item {
  display: flex; align-items: center; gap: 18px; padding: 20px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: transform .15s, border-color .15s;
}
.topic-item:hover { transform: translateX(4px); border-color: var(--border-hi); }
.topic-icon {
  flex-shrink: 0; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: rgba(106, 169, 255, 0.1);
  color: var(--accent); border-radius: 10px;
}
.topic-body { flex: 1; }
.topic-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.topic-desc { font-size: 13px; color: var(--muted); }
.topic-arrow { color: var(--muted-2); font-size: 18px; }

/* ===== PLACEHOLDER ===== */
.placeholder {
  padding: 60px 30px; text-align: center;
  background: var(--panel); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.placeholder-icon { font-size: 42px; margin-bottom: 12px; }
.placeholder h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.placeholder p { color: var(--muted); font-size: 14px; }

/* ============================================================
   ВЫЕЗЖАЮЩИЙ СЛАЙДЕР «ЧТО НОВОГО В КЛАССЕ»
   ============================================================ */

/* ── Контейнер ── */
.news-slider {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 0;
  z-index: 400;
  pointer-events: none;
}
.news-slider > * { pointer-events: auto; }

/* ── Вкладка (когда свёрнуто) ── */
.news-slider-tab {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(160deg, #4d8ef7, #7b5cff);
  border: none;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  box-shadow: -6px 0 24px rgba(77, 142, 247, .35);
  transition: transform .3s ease, opacity .3s ease, box-shadow .3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: .04em;
}

.news-slider-tab:hover {
  transform: translate(-3px, -50%);
  box-shadow: -8px 0 28px rgba(77, 142, 247, .55);
}

.news-slider-tab-icon {
  writing-mode: horizontal-tb;
  font-size: 18px;
  margin-bottom: 4px;
}

.news-slider-tab-text {
  font-size: 13.5px;
  font-weight: 600;
}

.news-slider-tab-count {
  writing-mode: horizontal-tb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 99px;
  margin-top: 4px;
}

/* ── Состояние «открыто»: прячем вкладку ── */
.news-slider.open .news-slider-tab {
  transform: translate(120%, -50%);
  opacity: 0;
  pointer-events: none;
}

/* ── Панель ── */
.news-slider-panel {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(100%, -50%);
  width: min(420px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-right: none;
  border-radius: 16px 0 0 16px;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .55);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}

.news-slider.open .news-slider-panel {
  transform: translate(0, -50%);
}

/* ── Шапка панели ── */
.news-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg,
              rgba(106, 169, 255, .08), transparent);
}

.news-slider-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.news-slider-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.news-slider-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.news-slider-close:hover {
  color: var(--err);
  border-color: var(--err);
  background: rgba(252, 165, 165, .08);
}

/* ── Список новостей ── */
.news-slider-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}

.news-slider-list::-webkit-scrollbar { width: 8px; }
.news-slider-list::-webkit-scrollbar-track { background: transparent; }
.news-slider-list::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 4px;
}

.news-item {
  padding: 14px 20px;
  border-bottom: 1px solid #1a1e27;
  transition: background .15s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: rgba(106, 169, 255, .04); }

.news-item-date {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.news-item-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  margin-right: 8px;
  vertical-align: middle;
}
.news-item-tag[data-tag="new"] {
  color: var(--accent);
  background: rgba(106, 169, 255, .12);
  border: 1px solid rgba(106, 169, 255, .35);
}
.news-item-tag[data-tag="tool"] {
  color: #4ade80;
  background: rgba(74, 222, 128, .1);
  border: 1px solid rgba(74, 222, 128, .3);
}
.news-item-tag[data-tag="fix"] {
  color: #ffd866;
  background: rgba(255, 216, 102, .1);
  border: 1px solid rgba(255, 216, 102, .3);
}

.news-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 6px 0 6px;
}

.news-item-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 8px;
}

.news-item-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
.news-item-link:hover { color: #fff; }

/* ── Подвал панели ── */
.news-slider-foot {
  padding: 14px 20px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
}
.news-slider-foot a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
.news-slider-foot a:hover { color: #fff; }

/* ── Затемнение фона ── */
.news-slider-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: -1;
}
.news-slider.open .news-slider-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ===== MOBILE ===== */
@media (max-width: 720px) {
  .burger { display: flex; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; background: var(--panel);
    border-bottom: 1px solid var(--border); padding: 10px; gap: 2px;
    transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: .2s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: 12px 16px; }
  .footer-inner { flex-direction: column; text-align: center; }

  /* Слайдер на мобильных */
  .news-slider-tab { padding: 14px 10px; }
  .news-slider-tab-text { font-size: 12px; }
  .news-slider-panel {
    width: 50vw;
    max-height: 85vh;
  }
  .news-slider-head { padding: 14px 16px 12px; }
  .news-item { padding: 12px 16px; }
}

/* ===== ANCHORS: не прячем под фиксированной шапкой ===== */
[id] { scroll-margin-top: 90px; } 