/* Библия стартапа — light, airy, text-first */

@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,500;0,7..72,600;1,7..72,400&family=Manrope:wght@500;600;700&display=swap');

:root {
  --white: #ffffff;
  --text: #1a1a1a;
  --text-soft: #3a3a3a;
  --text-muted: #888888;
  --border: #eeeeee;
  --sidebar-width: 200px;
  --toc-width: 9rem;
  --header-height: 56px;
  --content-max: 52rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Literata', Georgia, serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #f0f0f0;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: #cccccc;
  text-underline-offset: 3px;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--header-height);
}

@media (min-width: 640px) {
  .site-header__inner {
    padding: 0 1.5rem;
    gap: 1.5rem;
  }
}

.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  flex-shrink: 0;
  text-decoration: none;
  padding: 0.35rem 0;
}

.site-header__brand:hover {
  text-decoration: none;
}

.site-header__brand-name {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.site-header__brand-tag {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.site-header__nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

@media (min-width: 768px) {
  .site-header__nav {
    display: flex;
  }
}

.site-header__nav-link {
  padding: 0.4rem 0.65rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-header__nav-link:hover {
  color: var(--text);
  background: #f7f7f7;
  text-decoration: none;
}

.site-header__nav-link.is-active {
  color: var(--text);
  background: #f0f0f0;
  font-weight: 600;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 768px) {
  .site-header__actions {
    margin-left: 0;
  }
}

.site-header__cta {
  display: none;
  padding: 0.45rem 0.85rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.site-header__cta:hover {
  border-color: #cccccc;
  background: #fafafa;
  text-decoration: none;
}

@media (min-width: 1024px) {
  .site-header__cta {
    display: inline-flex;
  }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.menu-toggle:hover {
  opacity: 0.88;
}

.menu-toggle__icon {
  position: relative;
  width: 0.85rem;
  height: 0.55rem;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}

.menu-toggle__icon::before {
  top: 0;
  box-shadow: 0 0.22rem 0 currentColor;
}

.menu-toggle__icon::after {
  bottom: 0;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

body.menu-open {
  overflow: hidden;
}

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: min(var(--sidebar-width), 80vw);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 90;
}

.sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: var(--header-height);
    transform: none;
    width: var(--sidebar-width);
  }
}

.sidebar-nav {
  padding: 1rem 0 2rem;
}

.sidebar-nav__group {
  margin-bottom: 1.25rem;
}

.sidebar-nav__group:last-child {
  margin-bottom: 0;
}

.sidebar-nav__label {
  padding: 0 1rem 0.35rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbbbbb;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.22rem 1rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--text);
}

.sidebar-nav a.active {
  color: var(--text);
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  z-index: 80;
}

.sidebar-overlay.is-visible {
  display: block;
}

@media (min-width: 1024px) {
  .sidebar-overlay {
    display: none !important;
  }
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2rem 1.25rem 5rem;
}

@media (min-width: 640px) {
  .content {
    padding: 2.5rem 2rem 5rem;
  }
}

@media (min-width: 1024px) {
  .content {
    padding: 3rem 3rem 6rem;
  }
}

.content-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
  max-width: calc(var(--content-max) + var(--toc-width) + 4rem);
  margin: 0 auto;
}

@media (min-width: 1280px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) var(--toc-width);
    align-items: start;
  }
}

.content-grid--single {
  max-width: var(--content-max);
}

.article {
  min-width: 0;
}

/* Typography */
h1 {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1.75rem;
}

.lede {
  margin: 0 0 2.5rem;
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.lede strong {
  font-weight: 600;
  color: var(--text);
}

h2 {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 3rem 0 1.25rem;
}

h2:first-of-type {
  margin-top: 0;
}

h3 {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.65rem;
  color: var(--text);
}

.chapter-section h3 {
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.85rem;
}

.chapter-section h3:first-of-type {
  margin-top: 0;
}

p {
  margin: 0 0 1.15rem;
}

ul, ol {
  margin: 0 0 1.15rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: #cccccc;
}

.chapter-section {
  margin: 0;
}

/* Compare examples */
.compare {
  display: grid;
  gap: 2rem;
  margin: 0.5rem 0 0;
}

@media (min-width: 720px) {
  .compare {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .compare__item:first-child {
    padding-right: 2.5rem;
    border-right: 1px solid var(--border);
  }

  .compare__item:last-child {
    padding-left: 2.5rem;
  }
}

.compare__item {
  margin: 0;
}

figure.compare__item {
  margin: 0;
}

.compare__quote {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.05rem;
  line-height: 1.72;
  quotes: « » « »;
}

.compare__label {
  display: block;
  margin-bottom: 0.85rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compare__item--bad .compare__label {
  color: #a3a3a3;
}

.compare__item--good .compare__label {
  color: var(--text);
}

.compare__item--bad .compare__quote {
  color: #999999;
  font-style: italic;
}

.compare__item--good .compare__quote {
  color: var(--text);
}

.compare__quote::before {
  content: open-quote;
}

.compare__quote::after {
  content: close-quote;
}

/* Info lists */
.info-list {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.info-list li {
  margin: 0 0 1.75rem;
  padding: 0;
}

.info-list li:last-child {
  margin-bottom: 0;
}

.info-list strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.info-list p {
  margin: 0;
  color: var(--text-soft);
}

.info-list--compact li {
  margin-bottom: 0.65rem;
  font-size: 0.98rem;
  color: var(--text-soft);
}

.info-list--compact li:last-child {
  margin-bottom: 0;
}

/* Home page */
.hero__subtitle {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 0 0 1.15rem;
}

.hero__pitch {
  margin: 0 0 2.5rem;
  color: var(--text-soft);
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.link-list li {
  margin: 0 0 0.5rem;
  padding: 0;
}

.link-list a {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.9rem;
}

.route-block {
  margin-bottom: 2rem;
}

.route-block h3 {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.route-block ol {
  margin: 0;
}

/* Glossary */
.glossary dl {
  margin: 0;
}

.glossary dt {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

.glossary dt:first-child {
  margin-top: 0;
}

.glossary dd {
  margin: 0.25rem 0 0;
  color: var(--text-soft);
}

/* Plan days */
.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: day;
}

.plan-list li {
  counter-increment: day;
  margin: 0 0 1.5rem;
  padding: 0 0 0 2.5rem;
  position: relative;
}

.plan-list li::before {
  content: counter(day);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-list strong {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.plan-list p {
  margin: 0;
  color: var(--text-soft);
}

/* Map list */
.map-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.map-list li {
  counter-increment: step;
  margin: 0 0 1.25rem;
  padding: 0 0 0 2rem;
  position: relative;
}

.map-list li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 600;
  color: var(--text-muted);
}

.map-list strong {
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.map-list p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* Legal disclaimer */
.disclaimer {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Page TOC */
.page-toc {
  display: none;
  position: sticky;
  top: calc(var(--header-height) + 2rem);
}

@media (min-width: 1280px) {
  .page-toc {
    display: block;
  }
}

.page-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-toc a {
  display: block;
  padding: 0.2rem 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-muted);
  text-decoration: none;
}

.page-toc a:hover,
.page-toc a.is-active {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: #cccccc;
}

/* Chapter nav */
.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .chapter-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.chapter-nav a {
  text-decoration: none;
  color: var(--text-muted);
}

.chapter-nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: #cccccc;
}

.chapter-nav a:last-child {
  text-align: left;
}

@media (min-width: 640px) {
  .chapter-nav a:last-child {
    text-align: right;
  }
}
