:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-2: #e8f1ec;
  --text: #17251f;
  --muted: #5b6f66;
  --accent: #23795a;
  --accent-dark: #17573f;
  --border: #d5e3dc;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(23, 37, 31, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 560px at 8% -10%, #dcefe6 0%, rgba(220, 239, 230, 0) 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(35, 121, 90, 0.35);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(243, 247, 245, 0.93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.logo__text {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.menu {
  position: relative;
  margin-left: auto;
}

.menu__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.menu__summary::-webkit-details-marker {
  display: none;
}

.menu__summary::after {
  color: var(--accent);
  content: "▾";
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}

.menu[open] .menu__summary::after {
  transform: rotate(180deg);
}

.menu__summary:hover {
  border-color: var(--accent);
}

.menu__count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-size: 0.78rem;
}

.menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu__link {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.3;
  text-decoration: none;
}

.menu__link:hover {
  background: var(--surface-2);
  color: var(--accent-dark);
}

.menu__link[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

main {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px);
}

.index__intro {
  max-width: 760px;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list__item {
  display: flex;
}

.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.file-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.file-card__num {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-card__title {
  font-size: 1.15rem;
  font-weight: 650;
}

.file-card__desc {
  color: var(--muted);
  font-size: 0.94rem;
}

.file-card__file {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.file-card__arrow {
  position: absolute;
  top: 16px;
  right: 18px;
  color: var(--accent);
  font-size: 1.1rem;
}

.slide {
  max-width: 1000px;
}

.slide--image {
  max-width: 1200px;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
}

.slide-figure {
  margin: 26px 0 0;
}

.slide-figure__link {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.slide-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.slide-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plain-list strong {
  color: var(--accent-dark);
}

.steps {
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 58px;
}

.steps li::before {
  position: absolute;
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  counter-increment: step;
  content: counter(step);
}

.note {
  margin: 24px 0 0;
  padding: 14px 18px;
  border: 1px solid #efdfae;
  border-radius: 12px;
  background: #fff8e6;
  color: #6b5316;
  font-size: 0.92rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pager__link {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 0.92rem;
  text-decoration: none;
}

.pager__link:hover {
  border-color: var(--accent);
}

.pager__link--toc {
  color: var(--muted);
}

.site-footer {
  padding: 18px clamp(16px, 4vw, 48px) 26px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .menu__panel {
    width: calc(100vw - 32px);
  }

  .menu__summary {
    padding: 7px 12px;
  }

  .file-list {
    grid-template-columns: 1fr;
  }

  .file-card__arrow {
    display: none;
  }

  .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .pager__link {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* Стартовая страница: визуальный язык example (шапка, hero, карточки-кнопки). */
body[data-page="index"] {
  --hub-bg: #f8fafc;
  --hub-surface: #ffffff;
  --hub-border: #e2e8f0;
  --hub-primary: #0066cc;
  --hub-text: #334155;
  --hub-muted: #64748b;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}

body[data-page="index"] a {
  color: inherit;
}

.hub-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 28px 10px 36px;
  background: var(--hub-surface);
  border-bottom: 1px solid var(--hub-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hub-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hub-text);
  font-weight: 700;
  text-decoration: none;
}

.hub-logo__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e8f3ff;
  color: var(--hub-primary);
}

.hub-logo__mark svg {
  width: 20px;
  height: 20px;
}

.hub-logo__text {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.hub-header__meta {
  margin-left: auto;
  color: var(--hub-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.hub-header__meta strong {
  display: block;
  color: var(--hub-text);
  font-size: 13px;
  font-weight: 700;
}

body[data-page="index"] main.hub {
  width: min(1180px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 20px 32px 48px;
}

.hub-hero {
  position: relative;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 28px 32px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(105deg, #5eb0f0 0%, #e85d6f 42%, #1a4f9c 78%, #003d7a 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(15, 23, 42, 0.1);
  isolation: isolate;
}

.hub-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hub-hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
}

.hub-hero__blob--blue {
  width: 52%;
  height: 150%;
  background: #0066cc;
  left: -12%;
  top: 50%;
  transform: translateY(-48%);
}

.hub-hero__blob--red {
  width: 46%;
  height: 140%;
  background: #c8102e;
  left: 22%;
  top: 50%;
  transform: translateY(-52%);
  filter: blur(52px);
}

.hub-hero__blob--sky {
  width: 40%;
  height: 120%;
  background: #4d9fff;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  filter: blur(64px);
  opacity: 0.55;
}

.hub-hero__shape {
  position: absolute;
  pointer-events: none;
}

.hub-hero__shape--ring-lg {
  width: 132px;
  height: 132px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  right: 14%;
  top: -42%;
}

.hub-hero__shape--ring-sm {
  width: 58px;
  height: 58px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  left: 38%;
  bottom: -28%;
}

.hub-hero__shape--arc {
  width: 96px;
  height: 96px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.22) transparent transparent transparent;
  right: 32%;
  top: -18%;
  transform: rotate(38deg);
}

.hub-hero__shape--pill {
  width: 168px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  left: -4%;
  bottom: 8%;
  transform: rotate(-11deg);
}

.hub-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 32px);
}

.hub-hero__text {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.hub-hero__art {
  flex: 0 0 auto;
  display: block;
  width: clamp(104px, 14vw, 148px);
  height: auto;
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px -10px rgba(3, 22, 51, 0.5);
}

.hub-hero h1 {
  margin: 0;
  color: #fff;
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-shadow: 0 1px 10px rgba(15, 23, 42, 0.22);
}

.hub-hero p {
  max-width: min(560px, 100%);
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-shadow: 0 1px 8px rgba(15, 23, 42, 0.18);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.hub-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 196px;
  padding: 18px 16px 14px;
  border: 1px solid var(--hub-border);
  border-radius: 20px;
  background: var(--hub-surface);
  color: var(--hub-text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(15, 23, 42, 0.1);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover {
  border-color: color-mix(in srgb, var(--hub-primary) 45%, var(--hub-border));
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 28px -8px rgba(15, 23, 42, 0.14);
}

.hub-card:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.35);
  outline-offset: 2px;
}

.hub-card__body {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.hub-card strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.hub-card__body span {
  color: var(--hub-muted);
  font-size: 13px;
  line-height: 1.4;
}

.hub-card__icon {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  margin-top: auto;
  align-self: flex-end;
  border-radius: 14px;
  background: #e8f3ff;
  color: var(--hub-primary);
}

.hub-card__icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.hub-card:hover .hub-card__icon {
  background: color-mix(in srgb, var(--hub-primary) 16%, #fff);
}

body[data-page="index"] .site-footer {
  border-top-color: var(--hub-border);
  background: var(--hub-bg);
  color: var(--hub-muted);
}

@media (max-width: 1100px) {
  .hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hub-header {
    padding: 10px 16px;
  }

  body[data-page="index"] main.hub {
    padding: 16px 16px 36px;
  }

  .hub-hero {
    padding: 22px 20px;
    border-radius: 18px;
  }

  .hub-hero h1 {
    font-size: 26px;
  }

  .hub-hero__art {
    width: 96px;
    padding: 10px;
    border-radius: 16px;
  }

  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hub-header__meta {
    display: none;
  }

  .hub-hero__art {
    width: 76px;
    padding: 8px;
    border-radius: 14px;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .hub-card {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 0;
    padding: 16px;
  }

  .hub-card__icon {
    order: -1;
    margin-top: 0;
    align-self: center;
  }
}


