/* === Claude Setup Bible v2 · Reader styles === */
:root {
  --bg: #1a1410;
  --bg-2: #221a14;
  --surface: #2d2418;
  --surface-2: #3a2f20;
  --line: #4a3d2a;
  --text: #f4e3c1;
  --text-dim: #b8a685;
  --muted: #8b7a5f;
  --accent: #ff6b35;
  --accent-2: #ffc145;
  --danger: #ff6b6b;
  --success: #c8e6b5;
  --serif: 'Unbounded', 'Bebas Neue', sans-serif;
  --sans: 'Golos Text', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --max: 720px;     /* book-width — комфортная длина строки */
  --max-wide: 1080px;
  --r: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at top left, rgba(255,107,53,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(255,193,69,0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
::selection { background: var(--accent); color: var(--bg); }

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
h1 { font-size: clamp(34px, 6vw, 56px); }
h2 { font-size: clamp(26px, 4vw, 36px); margin-top: 48px; }
h3 { font-size: clamp(20px, 3vw, 24px); margin-top: 32px; }
h4 { font-size: 18px; margin-top: 28px; font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; color: var(--accent-2); }

code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  color: var(--accent-2); border: 1px solid var(--line);
}
pre {
  font-family: var(--mono); background: var(--bg-2); padding: 20px;
  border-radius: var(--r); border-left: 3px solid var(--accent);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 20px 0;
}
pre code { background: transparent; padding: 0; color: var(--text); border: 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 24px; }

/* === STICKY TOP NAV === */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(26, 20, 16, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.topbar-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 12px;
  transition: border-color .15s, color .15s;
}
.topbar-back:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.topbar-crumb { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.topbar-crumb b { color: var(--text); }
.topbar-spacer { flex: 1; }
.topbar-counter {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.04em;
}
.progress-bar {
  height: 2px;
  background: var(--bg-2);
}
.progress-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  opacity: 0.7;
}

/* === CHAPTER PROGRESS — 12 segments showing where you are in the book === */
.chapter-progress {
  display: flex;
  gap: 3px;
  padding: 6px 16px 4px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.cp-seg {
  flex: 1;
  height: 5px;
  border-radius: 2px;
  background: var(--surface);
  transition: background .15s, transform .15s;
}
.cp-seg.done { background: var(--accent); opacity: 0.45; }
.cp-seg.current {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleY(1.6);
  box-shadow: 0 0 8px rgba(255,107,53,0.5);
}
.cp-seg.read { background: var(--success); opacity: 0.55; }
@media (max-width: 700px) {
  .chapter-progress { padding: 5px 12px 3px; gap: 2px; }
  .cp-seg { height: 4px; }
}

/* === CHAPTER HERO === */
.chapter-hero {
  padding: 64px 0 32px;
}
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.chapter-hero h1 {
  margin-bottom: 18px;
}
.chapter-hero h1 .accent { color: var(--accent); }
.chapter-lead {
  font-size: 19px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}
.chapter-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-family: var(--mono); font-size: 12px;
  color: var(--muted);
  padding-top: 20px; margin-top: 20px;
  border-top: 1px solid var(--line);
}
.chapter-meta span { display: inline-flex; align-items: center; gap: 6px; }
.chapter-meta b { color: var(--text-dim); font-weight: 500; }

/* === CONTENT === */
.chapter-body {
  padding: 24px 0 64px;
}
.chapter-body p { margin: 16px 0; }
.chapter-body ul, .chapter-body ol {
  margin: 16px 0; padding-left: 24px;
}
.chapter-body li { margin: 8px 0; }
.chapter-body strong { color: var(--text); }

.tbl-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: var(--bg-2); font-family: var(--mono); font-size: 12px;
  color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,107,53,0.04); }

/* Callouts */
.callout {
  padding: 20px 24px; margin: 24px 0;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}
.callout-label {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 10px;
}
.callout.archetype { border-left-color: var(--accent-2); }
.callout.archetype .callout-label { color: var(--accent-2); }
.callout.troubles { border-left-color: var(--danger); }
.callout.troubles .callout-label { color: var(--danger); }
.callout.note { border-left-color: var(--text-dim); }
.callout.note .callout-label { color: var(--text-dim); }

/* Checklist */
.checklist {
  margin: 24px 0; padding: 24px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
}
.checklist-label {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--success); margin-bottom: 16px;
}
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  transition: opacity .15s;
}
.check-box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 5px;
  margin-top: 2px;
  position: relative;
  transition: all .15s;
}
.check-item.done .check-box {
  background: var(--success);
  border-color: var(--success);
}
.check-item.done .check-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
}
.check-item.done .check-text {
  color: var(--muted);
  text-decoration: line-through;
}
.check-text { flex: 1; line-height: 1.5; }

/* CTA inline */
.cta-inline {
  margin: 32px 0;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(255,193,69,0.04));
  border: 1px solid var(--accent);
  border-radius: var(--r);
  text-align: center;
}
.cta-inline h3 { margin: 0 0 12px; }
.cta-inline p { margin: 0 0 16px; color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-2); color: var(--bg); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn .arr { transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

/* === FOOTER NAV (chapter prev/next) === */
.chapter-nav {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chapter-nav a, .chapter-nav .empty {
  display: block;
  padding: 18px 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.chapter-nav a:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}
.chapter-nav .nav-label {
  display: block;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.chapter-nav .nav-title {
  font-weight: 600;
  line-height: 1.3;
}
.chapter-nav .nav-next { text-align: right; }
.chapter-nav .empty { background: transparent; border-style: dashed; opacity: 0.4; }

/* Back to TOC */
.back-to-toc {
  text-align: center;
  margin-top: 28px;
}
.back-to-toc a {
  font-family: var(--mono); font-size: 13px;
  color: var(--text-dim);
}
.back-to-toc a:hover { color: var(--accent); }

/* === FOOTER === */
.site-footer {
  padding: 40px 0 60px;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* === HUB (index) === */
.hub-hero {
  padding: 80px 0 40px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at top, rgba(255,107,53,0.14) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(255,193,69,0.08) 0%, transparent 60%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.hub-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hub-hero-inner { position: relative; }
.hub-hero h1 {
  margin: 18px 0 18px;
  font-size: clamp(40px, 8vw, 78px);
}
.hub-hero h1 .accent { color: var(--accent); }
.hub-hero .lead {
  font-size: 20px; color: var(--text-dim);
  max-width: 640px; line-height: 1.55;
  margin-bottom: 32px;
}
.hub-meta {
  display: flex; flex-wrap: wrap; gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text-dim);
}
.hub-meta b { color: var(--text); font-weight: 500; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hub-toc {
  padding: 56px 0;
}
.hub-toc h2 {
  margin: 0 0 8px;
  font-size: 32px;
}
.hub-toc-sub {
  color: var(--text-dim);
  margin-bottom: 32px;
}
.toc-list {
  display: flex; flex-direction: column; gap: 12px;
  list-style: none; padding: 0; margin: 0;
}
.toc-item a {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
  align-items: center;
}
.toc-item a:hover {
  border-color: var(--accent);
  background: var(--surface);
  text-decoration: none;
  transform: translateY(-2px);
}
.toc-num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.toc-body .toc-eyebrow {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}
.toc-body .toc-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 6px;
}
.toc-body .toc-preview {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}
.toc-meta {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.toc-arrow {
  font-size: 22px; color: var(--accent);
  margin-left: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .topbar-crumb { display: none; }
  .topbar-inner { gap: 10px; padding: 12px 16px; }
  .container { padding: 0 18px; }
  .container-wide { padding: 0 18px; }
  .chapter-hero { padding: 40px 0 24px; }
  .chapter-meta { flex-direction: column; gap: 8px; }
  .chapter-nav { grid-template-columns: 1fr; }
  .chapter-nav .nav-next { text-align: left; }
  .toc-item a {
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 18px;
  }
  .toc-meta { display: none; }
  .toc-num { font-size: 24px; }
  .toc-body .toc-title { font-size: 17px; }
  .hub-hero { padding: 56px 0 24px; }
  .hub-hero h1 { font-size: 40px; }
  .hub-hero .lead { font-size: 17px; }
}
