/* ============================================================
   В продакшене этот блок лучше вынести в /files/main.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --logo-grad-1: #677fb2;
  --logo-grad-2: #8f72c4;
  --logo-grad-3: #6592c3;
  --accent: #8f72c4;
  --bg-light: #f7f8fc;
  --bg-dark: #0b0c10;
  --text: #2d2a3e;
  --text-muted: #6b6880;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 10px rgba(45, 42, 62, 0.06);
  --card-shadow-hover: 0 6px 20px rgba(45, 42, 62, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-light: #0b0c10;
    --text: #f1f0f5;
    --text-muted: #a7a4b8;
    --card-bg: #16161d;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.6);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Фоновые пятна (aurora) ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
}
.aurora span:nth-child(1) {
  width: 340px; height: 340px;
  background: var(--logo-grad-1);
  top: -60px; left: -120px;
}
.aurora span:nth-child(2) {
  width: 280px; height: 280px;
  background: var(--logo-grad-2);
  top: 45%; right: -110px;
}
.aurora span:nth-child(3) {
  width: 260px; height: 260px;
  background: var(--logo-grad-3);
  bottom: -80px; left: -60px;
}

/* ---- Контейнер ---- */
.shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Логотип ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  width: fit-content;
  margin: 0 auto 18px;
  transition: transform 0.2s ease;
}
.logo:hover { transform: scale(1.02); }

.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--logo-grad-1), var(--logo-grad-2) 50%, var(--logo-grad-3));
  box-shadow: 0 10px 24px rgba(103, 127, 178, 0.35);
}
.logo-orbit {
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-bottom-color: transparent;
  border-right-color: transparent;
  transform: rotate(-25deg);
  animation: orbit-spin 6s linear infinite;
}
.logo-core {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.5px;
}
.logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  margin: 0;
  line-height: 1;
}
.logo-tld { color: var(--accent); font-weight: 700; }

@keyframes orbit-spin {
  to { transform: rotate(335deg); }
}

/* ---- SEO-интро ---- */
.seo-intro {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  width: 100%;
}

/* ---- Меню разделов ---- */
.sections {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}
.section-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: var(--text);
  animation: card-fade 0.5s ease both;
}
.section-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.section-label {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  margin-left: 14px;
}
.section-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

@keyframes card-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Текстовые блоки ---- */
.about {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
  font-size: 13px;
  color: var(--text-muted);
}
.about h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.about p { margin-bottom: 10px; }
.about p:last-child { margin-bottom: 0; }
.about strong { color: var(--text); }

/* ---- Сторис-карточки ---- */
.stories {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.story-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-muted);
}
.story-image {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}
.story-content h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.story-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- Футер ---- */
.site-footer {
  width: 100%;
  text-align: center;
  padding: 20px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---- Теги ---- */
.site-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}
.site-tag {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-muted);
  box-shadow: var(--card-shadow);
}

/* ---- Адаптив ---- */
@media (max-width: 400px) {
  .shell { padding: 16px 12px 40px; }
  .logo-text { font-size: 22px; }
  .section-label { font-size: 14px; }
}

/* ---- Оглавление статьи ---- */
.toc {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 24px;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--accent);
}

.toc h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
}

.toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 8px;
  position: relative;
  padding-left: 32px;
  font-size: 14px;
}

.toc ol li::before {
  content: counter(toc-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--accent);
  width: 24px;
  text-align: right;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Якорные отступы, чтобы заголовок не прилипал к верху ---- */
h2[id], h3[id], h1[id] {
  scroll-margin-top: 20px;
}

/* ---- Кнопка "наверх" ---- */
article > p:last-child a {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--accent);
  background: var(--card-bg);
  border-radius: 999px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

article > p:last-child a:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}