:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-code: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-soft: #e0f2fe;
  --border: #e2e8f0;
  --warning-bg: #fef3c7;
  --warning-bd: #f59e0b;
  --success-bg: #d1fae5;
  --success-bd: #10b981;
  --danger-bg: #fee2e2;
  --danger-bd: #ef4444;
  --gold-bg: #fef9c3;
  --gold-bd: #eab308;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Full-width — растягиваемся на весь экран */
.container {
  max-width: none;
  margin: 0;
  padding: 28px 56px 96px;
}

/* Step-страницы — тоже full-width, но lead-параграфы и pre будут уже */
.container.narrow {
  max-width: none;
  padding: 28px 56px 96px;
}

/* На step-страницах ограничим длинный текст для читаемости */
.container.narrow main > p,
.container.narrow main > h2,
.container.narrow main > h3,
.container.narrow main > ul,
.container.narrow main > ol,
.container.narrow main > pre,
.container.narrow main > .callout,
.container.narrow main > table {
  max-width: 1100px;
}

.container.narrow main > .lead {
  max-width: 900px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 24px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.logo a {
  color: var(--text);
  text-decoration: none;
}

.logo .accent {
  color: var(--primary);
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--primary);
}

h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 18px;
}

.lead {
  font-size: 1.18rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.55;
  max-width: 760px;
}

h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 56px;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 18px;
  font-size: 1rem;
}

.lead + p {
  font-size: 1.05rem;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  margin: 16px 0 22px 26px;
}

li {
  margin-bottom: 8px;
  font-size: 1rem;
}

li ul, li ol {
  margin-top: 8px;
}

strong {
  font-weight: 700;
  color: var(--text);
}

code {
  background: var(--bg-code);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.92em;
  color: #1e293b;
}

pre {
  background: var(--bg-code);
  padding: 18px 22px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 14px 0 22px;
  font-size: 0.92rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ========== Callouts ========== */

.callout {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 6px;
  margin: 22px 0;
  font-size: 0.98rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.callout.warning  { background: var(--warning-bg); border-color: var(--warning-bd); }
.callout.warning  strong:first-child { color: #92400e; }
.callout.success  { background: var(--success-bg); border-color: var(--success-bd); }
.callout.success  strong:first-child { color: #065f46; }
.callout.danger   { background: var(--danger-bg);  border-color: var(--danger-bd); }
.callout.danger   strong:first-child { color: #991b1b; }

/* ========== Buttons ========== */

.btn {
  display: inline-block;
  background: var(--primary);
  color: white !important;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 8px;
  margin-right: 10px;
  transition: background 0.15s, transform 0.15s;
}

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

.btn.secondary {
  background: var(--bg-soft);
  color: var(--text) !important;
  border: 1.5px solid var(--border);
}

.btn.secondary:hover {
  background: var(--border);
}

/* ========== Steps list (главная) ========== */

.steps-list {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.steps-list li {
  padding: 0;
  margin-bottom: 0;
}

.steps-list a {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  height: 100%;
}

.steps-list a:hover {
  border-color: var(--primary);
  background: white;
  transform: translateY(-1px);
}

.step-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.4rem;
  min-width: 36px;
  line-height: 1;
}

.step-body {
  flex: 1;
}

.step-body strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--text);
}

.step-body span {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  display: block;
}

/* ========== Generic grids ========== */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 22px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }

.feature {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.feature strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}

.feature span {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ========== Pricing tier cards ========== */

.tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 28px 0;
}

.tier {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 22px 20px;
  background: white;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.tier:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.tier.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-soft) 0%, white 60%);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.1);
}

.tier .price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.tier .price-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.tier .name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.tier ul {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  flex: 1;
}

.tier li {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
  margin-bottom: 7px;
  line-height: 1.5;
}

.tier li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success-bd);
  font-weight: 700;
}

.tier .target {
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: auto;
}

/* ========== Misc ========== */

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

.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -2px;
  width: 22px;
  height: 22px;
  background: var(--success-bg);
  color: var(--success-bd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-code);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.95rem;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 600;
  background: var(--bg-soft);
}

.kbd {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

/* ========== Pager (step-страницы) ========== */

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  gap: 14px;
}

.pager a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s;
  flex: 1;
  min-width: 0;
}

.pager a.next {
  text-align: right;
  align-items: flex-end;
}

.pager a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.pager small {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  margin-bottom: 2px;
}

footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

footer a {
  color: var(--text-muted);
}

/* ========== Hero CTA section ========== */

.hero {
  margin-bottom: 24px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  margin-bottom: 32px;
}

/* ========== Адаптив ========== */

@media (max-width: 1200px) {
  .container { padding: 28px 36px 96px; }
  .container.narrow { padding: 28px 36px 96px; }
}

@media (max-width: 1000px) {
  .grid-4, .tiers { grid-template-columns: repeat(2, 1fr); }
  .steps-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  html { font-size: 14px; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.08rem; }
  .lead { font-size: 1.02rem; }
  .container { padding: 22px 18px 56px; }
  .container.narrow { padding: 22px 18px 56px; }
  header { flex-direction: column; gap: 14px; align-items: flex-start; }
  nav a { margin-left: 0; margin-right: 16px; }
  nav a:first-child { margin-left: 0; }
  .pager { flex-direction: column; }
  .pager a { width: 100%; }
  .pager a.next { text-align: left; align-items: flex-start; }
  .steps-list, .grid-2, .grid-3, .grid-4, .tiers {
    grid-template-columns: 1fr;
  }
  .btn { width: 100%; text-align: center; margin-right: 0; }
  .cta-row .btn { width: 100%; }
}
