/* Planveyor — сайт. Цвета знака: Python Green и Racing Yellow на графите (brand/README.md).
   Тёмная тема — основная, светлая включается кнопкой. */

:root {
  --paper: #0d1014;
  --paper-2: #121418;
  --surface: #16181d;
  --ink: #f3f1ea;
  --text: #dcdad2;
  --muted: #9d9b94;
  --line: #2c2e35;
  --line-2: #202228;
  --soft: #1c1e24;
  --accent: #00c76c;
  --accent-hover: #2fd88a;
  --on-accent: #0d1014;
  --accent-wash: rgba(0, 199, 108, 0.08);

  --panel: #08090c;
  --panel-2: #15171c;
  --panel-text: #f3f1ea;
  --panel-muted: #9d9b94;
  --panel-line: #26282f;
  --panel-accent: #00c76c;

  /* Рамка фокуса — второй цвет знака: заметна и на зелёных кнопках. */
  --focus: #f7c808;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 20px 44px -22px rgba(0, 0, 0, 0.8);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --paper: #f4f2ea;
  --paper-2: #eeebe1;
  --surface: #fbfaf6;
  --ink: #15171c;
  --text: #2a2c31;
  --muted: #5e5f64;
  --line: #d2cfc4;
  --line-2: #e2dfd5;
  --soft: #ebe8de;
  --accent: #007a42;
  --accent-hover: #00663a;
  --on-accent: #ffffff;
  --accent-wash: rgba(0, 150, 80, 0.09);
  --panel: #0d1014;
  --panel-2: #1a1c22;
  --panel-text: #f3f1ea;
  --panel-muted: #a3a199;
  --panel-line: #2c2e35;
  --panel-accent: #00c76c;
  --focus: #007a42;
  --shadow: 0 1px 0 rgba(13, 16, 20, 0.04), 0 18px 40px -22px rgba(13, 16, 20, 0.35);
  color-scheme: light;
}

/* ---------- База ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

.nb {
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .wrap {
    padding-inline: 32px;
  }
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
}

.nav {
  margin-left: auto;
  position: static;
}

.nav__list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list a {
  display: block;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.93rem;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav__list a:hover,
.nav__list a[aria-current="true"] {
  color: var(--ink);
  background: var(--soft);
}

.nav__toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav__toggle:hover,
.theme-toggle:hover {
  border-color: var(--muted);
}

.theme-toggle {
  width: 40px;
  padding: 0;
  flex: none;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* В тёмной теме кнопка предлагает солнце, в светлой — луну. */
.theme-toggle .i-moon,
:root[data-theme="light"] .theme-toggle .i-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .i-moon {
  display: block;
}

.nav__toggle {
  display: none;
  padding: 0 14px;
}

.nav__toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

@media (max-width: 959px) {
  .nav__toggle {
    display: inline-flex;
  }

  .nav__list {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .nav.is-open .nav__list {
    display: flex;
  }

  .nav__list a {
    padding: 13px 12px;
    border-radius: 10px;
    font-size: 1.05rem;
  }
}

/* Другая языковая версия: в шапке на широком экране, последним пунктом меню на узком. */

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.lang:hover {
  border-color: var(--muted);
}

.nav__lang {
  display: none;
}

@media (max-width: 959px) {
  .lang {
    display: none;
  }

  .nav__list .nav__lang {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-2);
    counter-increment: none;
  }

  .nav__list .nav__lang a::before {
    content: none;
  }

  /* Ссылка на другую страницу сайта идёт без номера раздела, первой в нижней группе. */
  .nav__list .nav__page {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-2);
    counter-increment: none;
  }

  .nav__list .nav__page + .nav__lang {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .nav__list .nav__page a::before {
    content: none;
  }
}

/* Восемь пунктов меню помещаются в шапку на ширине от 960 px, если сжать поля. */
@media (min-width: 960px) and (max-width: 1199px) {
  .nav__list a {
    padding-inline: 7px;
  }
}

/* ---------- Общие элементы разделов ---------- */

.section {
  padding-block: clamp(64px, 8vw, 112px);
  border-top: 1px solid var(--line);
}

.section__head {
  max-width: 860px;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow b {
  color: var(--accent);
  font-weight: 700;
}

.eyebrow::after {
  content: "";
  width: 48px;
  height: 1px;
  background: var(--line);
}

h2 {
  margin-top: 18px;
  font-size: clamp(2rem, 1.2rem + 2.7vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
}

h3 {
  font-size: clamp(1.28rem, 1.08rem + 0.75vw, 1.62rem);
  line-height: 1.2;
  letter-spacing: -0.024em;
}

.lead {
  max-width: 36em;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.34rem);
  line-height: 1.52;
  text-wrap: pretty;
}

.sub {
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: clamp(40px, 5vw, 48px);
  border-top: 1px solid var(--line-2);
}

.sub__head h3 {
  margin-top: 10px;
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.sub__head {
  max-width: 820px;
  margin-bottom: 32px;
}

.sub__head p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.1rem;
}

.tag .mono {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95em;
}

.tag {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.note {
  margin-top: 22px;
  max-width: 52em;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.prose p + p {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .lead,
  .col p,
  .note,
  .prose p {
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

/* ---------- Первый экран ---------- */

.hero {
  position: relative;
  padding-block: clamp(28px, 3vw, 40px) clamp(56px, 7vw, 96px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 78% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 65% at 78% 0%, #000 0%, transparent 72%);
  opacity: 0.75;
  pointer-events: none;
}

.hero > .wrap {
  position: relative;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.pill b {
  color: var(--ink);
  font-weight: 600;
}

.pill__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-out 2;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}

.hero h1 {
  max-width: 13.2em;
  margin-top: 20px;
  font-size: clamp(2.45rem, 1.15rem + 4.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.042em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lead {
  max-width: 38em;
  margin-top: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--ink);
}

/* ---------- Конвейер плана ---------- */

.conveyor {
  --n: 6;
  --step: 0;
  position: relative;
  margin: clamp(36px, 5vw, 48px) 0 0;
  padding: 26px 20px 22px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--panel-text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.conveyor::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(244, 242, 234, 0.07) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}

.conveyor > * {
  position: relative;
}

.conveyor__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-line);
}

.conveyor__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--panel-accent);
}

.conveyor__hint {
  color: var(--panel-muted);
  font-size: 0.92rem;
}

.conveyor__side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.conveyor__pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: transparent;
  color: var(--panel-text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.conveyor__pause:hover {
  border-color: var(--panel-accent);
}

.conveyor__pause[hidden] {
  display: none;
}

.conveyor__pause::before {
  content: "";
  width: 8px;
  height: 10px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.conveyor__pause[data-state="paused"]::before {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  border-right: 0;
}

.conveyor__owner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--panel-muted);
  font-size: 0.95rem;
}

.conveyor__owner b {
  color: var(--panel-text);
  font-weight: 650;
}

.conveyor__owner::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel-accent);
  border-radius: 50%;
  flex: none;
}

.lane {
  position: relative;
  margin-top: 18px;
}

.track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Вертикальная линия на телефоне */
.track::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--panel-line);
}

.station {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-content: start;
  gap: 2px 16px;
  padding: 12px 0;
}

.station__node {
  grid-row: span 3;
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border: 2px solid var(--panel-line);
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--panel-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.station__role {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--panel-text);
}

.station__what {
  color: var(--panel-muted);
  font-size: 0.93rem;
  line-height: 1.4;
}

.station__status {
  justify-self: start;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  color: var(--panel-muted);
  font-size: 0.76rem;
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.station.is-done .station__node {
  border-color: var(--panel-accent);
  background: var(--panel-accent);
  color: var(--panel);
}

.station.is-active .station__node {
  border-color: var(--panel-accent);
  background: var(--panel);
  color: var(--panel-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--panel-accent) 18%, transparent);
}

.station.is-active .station__status {
  color: var(--panel);
  background: var(--panel-accent);
  border-color: var(--panel-accent);
}

.chip {
  display: none;
}

.rail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--panel-line);
  color: var(--panel-muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.rail b {
  margin-right: 2px;
  color: var(--panel-text);
  font-weight: 650;
}

@media (min-width: 960px) {
  .conveyor {
    padding: 24px 32px 26px;
  }

  .conveyor__owner {
    margin-top: 16px;
  }

  .lane {
    margin-top: 54px;
  }

  .track {
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  }

  .track::before {
    left: calc(100% / var(--n) / 2);
    right: calc(100% / var(--n) / 2);
    top: 13px;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .track::after {
    content: "";
    position: absolute;
    left: calc(100% / var(--n) / 2);
    top: 13px;
    height: 2px;
    width: calc(var(--step) * 100% / var(--n));
    background: var(--panel-accent);
    transition: width 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  }

  .station {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    justify-items: center;
    gap: 0;
    padding: 0 8px;
    text-align: center;
  }

  .station__node {
    grid-row: auto;
    margin: 0 0 16px;
  }

  .station__what {
    max-width: 13em;
    margin-top: 4px;
  }

  .station__status {
    justify-self: center;
    margin-top: 12px;
    white-space: normal;
    text-align: center;
    text-wrap: balance;
  }

  .js .chip {
    position: absolute;
    top: -46px;
    left: calc((var(--step) + 0.5) * 100% / var(--n));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 9px;
    border-radius: 9px;
    background: var(--panel-text);
    color: var(--panel);
    font-size: 0.85rem;
    font-weight: 650;
    white-space: nowrap;
    transform: translateX(-50%);
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
    transition: left 0.9s cubic-bezier(0.65, 0, 0.35, 1);
  }

  .js .chip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: var(--panel-text);
    transform: translateX(-50%) rotate(45deg);
  }

  .chip svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
  }

  .rail {
    margin-top: 26px;
    padding-right: 22%;
  }
}

.conveyor.is-resetting .track::after,
.conveyor.is-resetting .chip {
  transition: none;
}

/* 3D-конвейер над схемой (assets/conveyor): блок без карточки, схема в цветах темы страницы */
.conveyor--machine {
  --panel: var(--paper);
  --panel-text: var(--ink);
  --panel-muted: var(--muted);
  --panel-line: var(--line);
  --panel-accent: var(--accent);
  padding: 24px 0 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

.conveyor--machine::before {
  display: none;
}

.conveyor--machine .conveyor__top {
  padding-bottom: 12px;
}

.conveyor--machine .conveyor__owner {
  margin-top: 24px;
}

.conveyor--machine .lane {
  padding-top: 22px;
}

.conveyor--machine .station.is-active .station__status {
  white-space: normal;
}

@media (max-width: 759px) {
  .conveyor--machine {
    margin-top: 24px;
  }

  .conveyor--machine .conveyor__top {
    display: block;
  }

  .conveyor--machine .conveyor__side {
    margin-top: 5px;
  }
}

/* ---------- Откуда ---------- */

.origin {
  display: grid;
  gap: 40px;
}

.origin__more {
  margin: -16px 0 0;
  font-size: 0.95rem;
}

/* ---------- Что пробовали ---------- */

.why__example {
  max-width: 760px;
  margin: 40px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--line);
  color: var(--text);
}

.why__example b {
  color: var(--ink);
}

.why__rules {
  margin-top: 48px;
}

.why__quote {
  margin: 48px 0 0;
  padding-left: 22px;
  border-left: 3px solid var(--focus);
}

.why__quote p {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
  font-weight: 650;
  color: var(--ink);
  text-wrap: balance;
}

.why__quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

.why__note {
  margin: 28px 0 0;
  color: var(--muted);
}

.timeline-h {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-h li {
  position: relative;
  padding: 0 0 26px 30px;
}

.timeline-h li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: var(--paper);
}

.timeline-h li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-h li:last-child::after {
  display: none;
}

.timeline-h li:last-child::before {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline-h time {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.timeline-h b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.timeline-h li:last-child b {
  color: var(--accent);
}

.timeline-h span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

@media (min-width: 860px) {
  .timeline-h {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .timeline-h li {
    padding: 30px 0 0;
  }

  .timeline-h li::before {
    top: 0;
  }

  .timeline-h li::after {
    left: 22px;
    right: -26px;
    top: 6px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .timeline-h b {
    font-size: 1.85rem;
  }
}

/* ---------- Полоса шагов ---------- */

.flow {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--panel-text);
  overflow: hidden;
}

.flow li {
  position: relative;
  padding: 16px 20px;
}

.flow li + li {
  border-top: 1px solid var(--panel-line);
}

.flow__n {
  color: var(--panel-accent);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.flow b {
  display: block;
  margin-top: 6px;
  font-size: 1.28rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.flow span:last-child {
  display: block;
  margin-top: 4px;
  color: var(--panel-muted);
  font-size: 0.98rem;
}

@media (min-width: 860px) {
  .flow {
    grid-template-columns: repeat(4, 1fr);
  }

  .flow li {
    padding: 24px 26px;
  }

  .flow li + li {
    border-top: 0;
    border-left: 1px solid var(--panel-line);
  }

  .flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    right: -8px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--panel-line);
    border-right: 1px solid var(--panel-line);
    background: var(--panel);
    transform: translateY(-50%) rotate(45deg);
  }
}

/* ---------- Колонки ---------- */

.cols {
  display: grid;
  gap: 32px;
  margin-top: 44px;
}

.cols--tight {
  margin-top: 0;
}

@media (min-width: 760px) {
  .cols {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }

  .cols--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.col,
.state article,
.roadmap article {
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.col::before,
.state article::before,
.roadmap article::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
}

.col--accent::before,
.state article:last-child::before,
.roadmap article::before {
  background: var(--accent);
}

.col h3 {
  margin-top: 10px;
  font-size: 1.36rem;
}

.col p,
.col ul {
  margin-top: 10px;
}

.col ul {
  padding-left: 1.1em;
}

.col li + li {
  margin-top: 6px;
}

.kv {
  margin: 12px 0 0;
}

.kv div + div {
  margin-top: 8px;
}

.kv dt {
  display: inline;
  color: var(--ink);
  font-weight: 650;
}

.kv dd {
  display: inline;
  margin: 0;
}

/* ---------- Полоса-пояснение ---------- */

.band {
  display: grid;
  gap: 6px 28px;
  margin-top: 32px;
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.band b {
  color: var(--ink);
  font-weight: 650;
  text-wrap: balance;
}

@media (min-width: 760px) {
  .band {
    grid-template-columns: 280px 1fr;
    align-items: baseline;
    padding: 22px 26px;
  }
}

/* ---------- Цитата и принципы ---------- */

.thesis {
  display: grid;
  gap: 32px;
  margin-top: clamp(48px, 6vw, 72px);
}

@media (min-width: 900px) {
  .thesis {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: start;
  }
}

.quote {
  margin: 0;
  padding-left: 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: clamp(1.4rem, 1.08rem + 1.25vw, 2.05rem);
  font-weight: 560;
  line-height: 1.26;
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.quote cite {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---------- Таблицы ---------- */

.table-wrap {
  margin-top: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.5;
}

.table th {
  padding: 0 20px 12px 0;
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.table td {
  padding: 16px 20px 16px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table td:last-child,
.table th:last-child {
  padding-right: 0;
}

.table td:first-child {
  color: var(--ink);
  font-weight: 650;
}

.table--roles td:first-child {
  width: 14%;
}

.table--roles td:nth-child(2) {
  width: 40%;
}

.table .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 759px) {
  .table:not(.table--keep),
  .table:not(.table--keep) tbody,
  .table:not(.table--keep) tr,
  .table:not(.table--keep) td {
    display: block;
    width: 100% !important;
  }

  .table:not(.table--keep) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table:not(.table--keep) tr {
    padding: 16px 0;
    border-top: 1px solid var(--line);
  }

  .table:not(.table--keep) tr:last-child {
    border-bottom: 1px solid var(--line);
  }

  .table:not(.table--keep) td {
    padding: 3px 0;
    border: 0;
  }

  .table:not(.table--keep) td:first-child {
    font-size: 1.12rem;
    padding-bottom: 6px;
  }

  .table:not(.table--keep) td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .table:not(.table--keep) td[data-label]:not(:first-child) + td[data-label] {
    margin-top: 8px;
  }

  .table--tests td[data-label]:not(:first-child) {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-top: 0 !important;
  }

  .table--tests td[data-label]:not(:first-child)::before {
    flex: 0 0 96px;
  }
}

/* ---------- Пять артефактов ---------- */

.stack {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.stack li:last-child {
  border-bottom: 1px solid var(--line);
}

.stack__n {
  grid-row: span 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 0.95rem;
}

.stack h4 {
  margin-top: 0;
  line-height: 1.45;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.stack p {
  color: var(--text);
}

.stack small {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 900px) {
  .stack li {
    grid-template-columns: 40px 230px 1fr;
    gap: 6px 24px;
    align-items: start;
  }

  .stack__n {
    grid-row: span 2;
  }

  .stack h4 {
    grid-row: span 2;
  }

  .stack p {
    font-size: 1.12rem;
  }
}

/* ---------- Карточки ---------- */

.cards {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .cards--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cards--spaced {
  margin-top: 44px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 24px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin-top: 10px;
  font-size: 1.35rem;
}

.card p {
  margin-top: 10px;
}

.card .kv {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  font-size: 0.97rem;
}

.card__cmd {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
}

/* ---------- Цепочки ---------- */

.chain {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.chain li {
  position: relative;
  padding: 18px 20px;
}

.chain li + li {
  border-top: 1px solid var(--line);
}

.chain b {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.chain span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.chain li:last-child b {
  color: var(--accent);
}

@media (min-width: 860px) {
  .chain {
    grid-template-columns: repeat(4, 1fr);
  }

  .chain--5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .chain li + li {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .chain li:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 50%;
    right: -7px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: var(--surface);
    transform: translateY(-50%) rotate(45deg);
  }
}

.cmdline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 22px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
}

.cmdline > span:first-child {
  margin-right: 4px;
  color: var(--ink);
  font-weight: 650;
}

.cmdline code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  white-space: nowrap;
}

.cmdline i {
  color: var(--muted);
  font-style: normal;
}

/* ---------- Ревью ---------- */

.gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.gate span {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.gate span:last-of-type {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.gate + .cols {
  margin-top: 36px;
}

.gate i {
  color: var(--accent);
  font-style: normal;
}

.pair {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

@media (min-width: 860px) {
  .pair {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.pair > div {
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.pair b {
  color: var(--ink);
}

.principles {
  display: grid;
  gap: 0;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.principles li {
  display: grid;
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.principles b {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.principles span {
  color: var(--muted);
}

@media (min-width: 860px) {
  .principles li {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: baseline;
  }
}

/* ---------- Sibling ---------- */

.repo {
  display: grid;
  gap: 18px;
}

.repo__box {
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 4px 0 var(--ink);
}

.repo__box--sibling {
  box-shadow: inset 0 4px 0 var(--accent);
}

.repo__box h3 {
  margin-top: 8px;
}

.repo__box--sibling h3 {
  color: var(--accent);
}

.repo__box ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.repo__box li {
  padding: 11px 0;
  border-top: 1px solid var(--line-2);
}

.repo__links {
  display: grid;
  gap: 12px;
  align-content: center;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.repo__link b {
  display: block;
  color: var(--ink);
  font-weight: 650;
}

.repo__arrow {
  display: block;
  color: var(--accent);
  font-size: 1.8rem;
  line-height: 1;
  transform: rotate(90deg);
}

@media (min-width: 900px) {
  .repo {
    grid-template-columns: 1fr 210px 1fr;
    gap: 26px;
  }

  .repo__arrow {
    font-size: 2.3rem;
    transform: none;
  }
}

/* ---------- Тёмный раздел: пример ---------- */

.section--dark {
  --focus: #f7c808;
  --ink: var(--panel-text);
  --text: #dcdad2;
  --muted: var(--panel-muted);
  --line: var(--panel-line);
  --line-2: #23262c;
  --soft: var(--panel-2);
  --surface: var(--panel-2);
  --accent: var(--panel-accent);
  --on-accent: #0d1014;
  --accent-wash: rgba(0, 199, 108, 0.1);
  background: radial-gradient(70% 50% at 85% 0%, rgba(0, 199, 108, 0.07), transparent 70%), var(--panel);
  color: var(--text);
  border-top: 0;
}

/* В тёмной теме раздел почти сливается с фоном: границы его отделяют. */
:root:not([data-theme="light"]) .section--dark {
  box-shadow: inset 0 1px 0 var(--panel-line), inset 0 -1px 0 var(--panel-line);
}

.case {
  display: grid;
  gap: 40px;
}

.case > div {
  min-width: 0;
}

.case .table-wrap {
  overflow-x: auto;
}

@media (min-width: 960px) {
  .case {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
  }

  .case > div + div {
    padding-left: 48px;
    border-left: 1px solid var(--line);
  }
}

.case h3 {
  margin-bottom: 16px;
}

.formula {
  margin: 28px 0 10px;
  color: var(--accent);
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.93rem;
}

.result {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 1rem;
}

.result li {
  display: grid;
  grid-template-columns: 3em 1fr auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.result li:first-child {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--ink);
}

.rules {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.rules li {
  position: relative;
  padding: 8px 0 8px 22px;
}

.rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.code {
  margin: 24px 0 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code .k {
  color: var(--accent);
}

.proof {
  display: grid;
  gap: 32px;
}

@media (min-width: 640px) {
  .proof {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

.bignum {
  color: var(--accent);
  font-size: clamp(4rem, 2.6rem + 5vw, 6.6rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.bignum small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.34em;
  letter-spacing: -0.01em;
}

.proof h3 {
  margin-top: 16px;
  font-size: 1.25rem;
}

.proof p {
  margin-top: 8px;
}

.statusline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.statusline li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 2px 14px;
  position: relative;
  padding: 0 0 18px;
}

.statusline li::before {
  content: "";
  position: absolute;
  left: 70px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.statusline li::after {
  content: "";
  position: absolute;
  left: 74px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.statusline li:last-child::after {
  display: none;
}

.statusline li:last-child::before {
  background: var(--accent);
}

.statusline time {
  grid-row: span 2;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.statusline code,
.statusline span {
  padding-left: 26px;
}

.statusline code {
  color: var(--ink);
  font-size: 0.86rem;
}

.statusline li:last-child code {
  color: var(--accent);
}

.statusline span {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.order {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.97rem;
}

.order b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.case-foot {
  max-width: 52em;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

/* Вход в демо Northwind (/northwind/). Ссылка в заголовке растянута на всю карточку. */

.demo-entry {
  position: relative;
  display: grid;
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 56px);
  padding: 12px 12px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  transition: border-color 0.15s ease;
}

.demo-entry:hover {
  border-color: var(--accent);
}

/* Обложка 4:3. Раздел 07 тёмный в обеих темах, поэтому обложка всегда тёмная. */
.demo-entry__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.demo-entry__body {
  padding-inline: 8px;
}

.demo-entry__title {
  margin-top: 10px;
}

.demo-entry__title a {
  text-decoration: none;
}

.demo-entry__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.demo-entry__title a:focus-visible {
  outline: none;
}

.demo-entry__title a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.demo-entry__body p {
  margin-top: 10px;
  max-width: 34em;
  color: var(--muted);
}

.demo-entry__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 600;
}

.demo-entry__go svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.demo-entry:hover .demo-entry__go svg {
  transform: translateX(3px);
}

@media (min-width: 760px) {
  .demo-entry {
    grid-template-columns: minmax(0, 340px) 1fr;
    align-items: center;
    gap: 36px;
    padding: 12px 36px 12px 12px;
  }

  .demo-entry__body {
    padding-inline: 0;
  }
}

/* ---------- Состояние ---------- */

.state {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .state {
    grid-template-columns: 1fr 1.1fr;
    gap: 56px;
  }
}

.state h3 {
  margin-top: 10px;
}

.checks,
.steps {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.checks li,
.steps li {
  position: relative;
  padding: 13px 0 13px 36px;
  border-bottom: 1px solid var(--line);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-wash);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 21px;
  width: 6px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(40deg);
}

.steps {
  counter-reset: s;
}

.steps li {
  counter-increment: s;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 13px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.steps b,
.checks b {
  color: var(--ink);
  font-weight: 650;
}

/* Адрес в команде длиннее строки на телефоне: переносится в любом месте. */
.steps code {
  overflow-wrap: anywhere;
}

.roadmap {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .roadmap {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }
}

.roadmap h3 {
  margin-top: 10px;
}

.roadmap ul {
  margin: 14px 0 0;
  padding-left: 1.1em;
}

.roadmap li {
  margin: 10px 0;
}

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

.footer {
  --focus: #f7c808;
  padding-block: clamp(56px, 8vw, 96px) 40px;
  background: var(--panel);
  color: var(--panel-muted);
}

.footer__grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 860px) {
  .footer__grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: end;
  }
}

.footer .brand {
  color: var(--panel-text);
}

.footer__say {
  max-width: 30em;
  margin-top: 18px;
  color: var(--panel-text);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.contacts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contacts a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  color: var(--panel-text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.contacts a:hover {
  border-color: var(--panel-accent);
  background: var(--panel-2);
}

.contacts span {
  color: var(--panel-muted);
  font-size: 0.9rem;
}

.contacts b {
  min-width: 0;
  font-weight: 600;
  /* Адрес вроде planveyor.dev/compare переносится и на 320 px не раздвигает подвал. */
  overflow-wrap: anywhere;
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--panel-line);
  font-size: 0.9rem;
}

.footer__meta a {
  color: var(--panel-text);
}

/* ---------- Страница 404 ---------- */

.lost {
  min-height: calc(100vh - 64px);
  display: grid;
  align-content: center;
  padding-block: 64px;
}

.lost h1 {
  margin-top: 22px;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.048em;
}

/* ---------- Подробнее, призыв, команды ---------- */

.more {
  margin-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.more + .more {
  margin-top: 0;
  border-top: 0;
}

.more > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  list-style: none;
  cursor: pointer;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.more > summary:hover::after {
  border-color: var(--accent);
}

.more[open] > summary::after {
  content: "−";
}

.more__title {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  font-weight: 650;
  letter-spacing: -0.024em;
  line-height: 1.2;
}

.more__body {
  padding-bottom: 32px;
}

.more__lead {
  max-width: 44em;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.cta {
  padding-block: clamp(64px, 8vw, 104px);
  border-top: 1px solid var(--line);
  text-align: center;
}

.cta__eyebrow {
  justify-content: center;
}

.cta__eyebrow::after {
  display: none;
}

.cta h2 {
  margin-top: 14px;
}

.cta__actions {
  justify-content: center;
}

.cta__note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.col .rules,
.col .statusline {
  margin-top: 14px;
}

.case > div > .caption {
  margin-top: 12px;
}

p code {
  white-space: nowrap;
}

@media (min-width: 900px) {
  #work .card {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
  }
}

/* ---------- Телефон ---------- */

@media (max-width: 959px) {
  .nav.is-open::before {
    content: "";
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    height: 100vh;
    background: rgba(8, 9, 12, 0.45);
    pointer-events: none;
  }

  .nav.is-open .nav__toggle {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }

  .nav__list {
    z-index: 1;
    background: var(--surface);
    counter-reset: n 1;
  }

  .nav__list li {
    counter-increment: n;
  }

  .nav__list a::before {
    content: counter(n, decimal-leading-zero);
    margin-right: 12px;
    color: var(--accent);
    font: 600 0.8rem var(--mono);
  }

  .station.is-done::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 41px;
    bottom: -13px;
    width: 2px;
    background: var(--panel-accent);
  }
}

@media (max-width: 859px) {
  .flow li {
    display: grid;
    grid-template-columns: 2.2em 1fr;
    column-gap: 8px;
    padding: 14px 18px;
  }

  .flow__n {
    grid-row: span 2;
    padding-top: 7px;
  }

  .flow b {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .lead,
  .col p,
  .note,
  .prose p {
    hyphenate-limit-chars: 10 4 4;
    -webkit-hyphenate-limit-before: 4;
    -webkit-hyphenate-limit-after: 4;
  }

  .code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .pill {
    align-items: flex-start;
    border-radius: 14px;
  }

  .pill__dot {
    margin-top: 5px;
  }

  .actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---------- Страница Northwind ---------- */

/* /northwind/: компьютер из /assets/northwind/ (его стили и статичный экран) и общий
   northwind-init.js. Стили модуля ограничены корпусом .device, их токены — --nw-*, и они
   подключены после styles.css. Шапка, фон, поля вокруг корпуса и подпись под ним — правила
   сайта ниже. */

.nw-page {
  min-height: 100vh;
}

/* Меню разделов здесь нет: переключатель языка остаётся в шапке на любой ширине. */
.nw-page .lang {
  display: inline-flex;
}

/* У модуля рамка фокуса 2 px; в шапке остаётся рамка сайта. */
.nw-page .topbar :focus-visible,
.nw-page .skip:focus-visible {
  outline-width: 3px;
}

/* Поля вокруг корпуса и подпись под ним. */
.nw-page .studio {
  padding-top: clamp(8px, 2vw, 24px);
  padding-inline: 20px;
}

.nw-page .page-note {
  width: min(820px, 100%);
  margin: 0 auto 24px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 800px) {
  .nw-page .studio {
    padding-inline: 4px;
  }
}

/* Внутри корпуса — значения браузера: общие правила сайта для заголовков, абзацев, кода,
   иконок и классов .eyebrow и .code иначе попадают на экран модуля. Палитра модуля своя. */
.nw-page .device {
  -webkit-font-smoothing: auto;
  text-rendering: auto;
}

:where(.nw-page .device) :is(h1, h2, h3, h4) {
  color: inherit;
  font-weight: 700;
  line-height: normal;
  letter-spacing: inherit;
  text-wrap: wrap;
}

:where(.nw-page .device) h2 {
  margin-block: 0.83em;
  font-size: 1.5em;
}

:where(.nw-page .device) h3 {
  margin-block: 1em;
  font-size: 1.17em;
}

:where(.nw-page .device) p {
  margin-block: 1em;
}

:where(.nw-page .device) :is(code, p code) {
  font-family: monospace;
  font-size: inherit;
  white-space: inherit;
}

:where(.nw-page .device) svg {
  display: inline;
  max-width: none;
}

.nw-page .device .eyebrow {
  display: block;
  align-items: normal;
  gap: normal;
  letter-spacing: inherit;
}

.nw-page .device .eyebrow::after {
  content: none;
}

.nw-page .device .code {
  padding: 0;
  border-radius: 0;
  background: none;
  overflow-wrap: normal;
}

/* ---------- Движение ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .actions,
  .theme-toggle {
    display: none;
  }

  .section {
    break-inside: avoid-page;
  }
}

/* ---------- Контакты и ссылки на страницы сравнения и истории ---------- */

/* Раздел 08: пример и медианы одним блоком, под ними ссылка на /history/;
   в конце раздела ссылка на /compare/. */
.why__example p + p {
  margin-top: 12px;
}

.why__more {
  font-size: 0.95rem;
}

.why__more a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.why__more a:hover {
  color: var(--accent);
}

.why__compare {
  margin-top: 28px;
}

/* Длинная команда в примечании переносится по пробелам и не вылезает за край на телефоне. */
p code.code-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Блок «Контакты» над подвалом, якорь #contacts: на него ведут README Planveyor. */
.contact {
  padding-block: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.contact__inner {
  display: grid;
  gap: 20px;
}

.contact__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.contact__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__list li {
  display: flex;
}

.contact__list a {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.contact__list a:hover {
  border-color: var(--accent);
}

.contact__list span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.contact__list b {
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 860px) {
  .contact__inner {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }

  .contact__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
