/* SOL-67 «Человекоподобный робот» — блог проекта.
   Дизайн-токены по референс-палитре dataviz (light/dark выбраны, не инвертированы). */

:root {
  color-scheme: light;
  --page:            #f9f9f7;
  --surface-1:       #fcfcfb;
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --grid:            #e1e0d9;
  --baseline:        #c3c2b7;
  --border:          rgba(11, 11, 11, 0.10);
  --accent:          #2a78d6;   /* categorical slot 1, blue */
  --accent-ink:      #104281;
  --stage-1:         #86b6ef;   /* ordinal ramp: шаги 250..650 */
  --stage-2:         #5598e7;
  --stage-3:         #2a78d6;
  --stage-4:         #1c5cab;
  --stage-5:         #104281;
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-run:      #ec835a;
  --good-ink:        #006300;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:            #0d0d0d;
    --surface-1:       #1a1a19;
    --text-primary:    #ffffff;
    --text-secondary:  #c3c2b7;
    --text-muted:      #898781;
    --grid:            #2c2c2a;
    --baseline:        #383835;
    --border:          rgba(255, 255, 255, 0.10);
    --accent:          #3987e5;
    --accent-ink:      #9ec5f4;
    --stage-1:         #9ec5f4;  /* ordinal ramp для тёмной поверхности */
    --stage-2:         #6da7ec;
    --stage-3:         #3987e5;
    --stage-4:         #256abf;
    --stage-5:         #184f95;
    --status-good:     #0ca30c;
    --status-warning:  #fab219;
    --status-run:      #ec835a;
    --good-ink:        #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface-1:       #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --grid:            #2c2c2a;
  --baseline:        #383835;
  --border:          rgba(255, 255, 255, 0.10);
  --accent:          #3987e5;
  --accent-ink:      #9ec5f4;
  --stage-1:         #9ec5f4;
  --stage-2:         #6da7ec;
  --stage-3:         #3987e5;
  --stage-4:         #256abf;
  --stage-5:         #184f95;
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-run:      #ec835a;
  --good-ink:        #0ca30c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text-primary);
}
.brand svg { display: block; }
.brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}
.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--baseline); }

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

.hero { padding: 48px 0 8px; }
.hero .kicker {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.hero p.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 46rem;
  margin: 0 0 8px;
}
.hero .meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ---------- Карточки и секции ---------- */

section.block { padding: 28px 0; }
h2.section-title {
  font-size: 20px;
  margin: 0 0 4px;
}
p.section-note { color: var(--text-secondary); margin: 0 0 18px; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

/* ---------- KPI-плитки ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.stat-tile .value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat-tile .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.stat-tile .delta {
  font-size: 13px;
  color: var(--good-ink);
  margin-top: 2px;
}

/* ---------- Дорожная карта (ordinal ramp) ---------- */

.roadmap {
  display: flex;
  gap: 2px;              /* 2px surface gap между сегментами */
  margin: 6px 0 10px;
}
.roadmap .seg {
  flex: 1;
  height: 14px;
  border-radius: 4px;
  position: relative;
  transition: filter 0.15s ease;
}
.roadmap .seg:hover { filter: brightness(1.08); }
.roadmap .seg.current::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-primary);
  transform: translateX(-50%);
}
.roadmap-labels {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}
.roadmap-labels div {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  padding-right: 8px;
}
.roadmap-labels b { display: block; color: var(--text-primary); font-size: 13px; }
.roadmap-note { font-size: 13px; color: var(--text-muted); }

/* ---------- Статусные бейджи: иконка + подпись, не только цвет ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.badge.done .dot { background: var(--status-good); }
.badge.wip  .dot { background: var(--status-run); }

/* ---------- Таблица задач ---------- */

table.tasks {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
table.tasks th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--baseline);
}
table.tasks td {
  padding: 10px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
table.tasks tr:last-child td { border-bottom: none; }
table.tasks td.num { color: var(--text-muted); white-space: nowrap; }
table.tasks tr:hover td { background: color-mix(in srgb, var(--grid) 35%, transparent); }

/* ---------- Список постов ---------- */

.post-card {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}
.post-card:hover { border-color: var(--baseline); text-decoration: none; }
.post-card time { font-size: 13px; color: var(--text-muted); }
.post-card h3 { margin: 4px 0 6px; font-size: 18px; }
.post-card p { margin: 0; color: var(--text-secondary); font-size: 14.5px; }

/* ---------- Статья ---------- */

article.post { padding: 36px 0; }
article.post h1 { font-size: 30px; line-height: 1.25; margin: 6px 0 6px; letter-spacing: -0.01em; }
article.post .byline { font-size: 14px; color: var(--text-muted); margin-bottom: 26px; }
article.post h2 { font-size: 21px; margin: 34px 0 10px; }
article.post p { margin: 0 0 14px; color: var(--text-secondary); }
article.post p strong, article.post li strong { color: var(--text-primary); }
article.post ul, article.post ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-secondary); }
article.post figure { margin: 20px 0; }
article.post figcaption { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.backlink { display: inline-block; margin-top: 28px; font-size: 14px; }

/* ---------- Диаграммы/схемы ---------- */

figure.viz figure-caption { display: block; }
.viz-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.viz-card svg { display: block; width: 100%; height: auto; }
.viz-card .viz-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.viz-card .viz-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }

/* ---------- Сетка карточек-ограничений ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.rule-card h3 { margin: 0 0 6px; font-size: 15px; }
.rule-card p { margin: 0; font-size: 14px; color: var(--text-secondary); }

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 22px 0 34px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 27px; }
  .roadmap-labels b { font-size: 12px; }
  .roadmap-labels div { font-size: 11.5px; }
}
