@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --muted: #eaeae8;
  --muted-foreground: #6b6b6b;
  --border: #dcdcda;
  --input: #dcdcda;
  --primary: #0075de;
  --primary-foreground: #ffffff;
  --accent: #0075de;
  --accent-foreground: #ffffff;
  --ring: #0075de;
  --destructive: #e5484d;
  --guide-card: #f7f7f5;
  --footer-bg: #ededeb;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.85; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.cta-banner {
  display: block; margin: 22px auto 24px;
  border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border);
  max-width: 100%; background: var(--guide-card);
}
.cta-banner-img { display: block; width: 100%; height: auto; object-fit: contain; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.brand-mark { width: 32px; height: 32px; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.nav { display: none; gap: 28px; font-size: 13px; line-height: 1; }
.nav a { color: var(--foreground); opacity: 0.9; display: inline-flex; align-items: center; padding: 8px 0; line-height: 1; }
.nav a:hover { opacity: 0.7; }

.cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: var(--accent-foreground); font-weight: 700; font-size: 13px; line-height: 1; }

main { padding-top: 96px; padding-bottom: 64px; }

.page-title { font-size: 36px; line-height: 1.1; margin: 0; letter-spacing: -0.03em; }
.page-sub { margin-top: 10px; color: var(--muted-foreground); max-width: 60ch; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { padding: 10px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; border: 1px solid var(--border); background: #fff; color: var(--muted-foreground); }
.chip.is-active { background: var(--accent); color: var(--accent-foreground); border-color: transparent; }

.grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.card { background: var(--guide-card); border: 1px solid transparent; border-radius: var(--radius-xl); overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--border); }
.card-media { height: 130px; background: linear-gradient(135deg, rgba(0,117,222,0.12), rgba(0,0,0,0)); border-bottom: 1px solid rgba(0,0,0,0.04); position: relative; }
.card-media-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #0B1220; }
.card-body { padding: 16px 16px 18px; }
.card-kicker { display: inline-block; font-size: 12px; font-weight: 700; color: var(--muted-foreground); background: rgba(255,255,255,0.65); border: 1px solid rgba(0,0,0,0.06); padding: 5px 10px; border-radius: 999px; }
.card-title { margin: 10px 0 6px; font-size: 17px; letter-spacing: -0.02em; }
.card-desc { margin: 0; color: var(--muted-foreground); font-size: 13px; }

.footer { background: var(--footer-bg); border-top: 1px solid var(--border); padding: 44px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 22px; }
.footer-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); margin: 0 0 10px; }
.footer-link { font-size: 13px; color: var(--muted-foreground); display: inline-block; padding: 3px 0; }
.footer-link:hover { color: var(--foreground); }

.prose { max-width: 74ch; }
.prose h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; }
.prose h2 { font-size: 26px; margin-top: 38px; margin-bottom: 14px; letter-spacing: -0.02em; line-height: 1.2; }
.prose h3 { font-size: 19px; margin-top: 26px; margin-bottom: 10px; letter-spacing: -0.015em; }
.prose p { margin: 10px 0; }
.prose ul { margin: 10px 0; padding-left: 18px; }
.prose ol { margin: 10px 0; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose a { text-decoration: underline; text-decoration-color: rgba(0, 117, 222, 0.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: rgba(0, 117, 222, 0.65); }
.prose mark { background: rgba(0, 117, 222, 0.12); color: inherit; padding: 2px 6px; border-radius: 8px; }
.prose blockquote { margin: 16px 0; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); border-left: 4px solid rgba(0, 117, 222, 0.6); background: rgba(0, 117, 222, 0.04); }
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.95em; background: rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.05); padding: 2px 6px; border-radius: 8px; }
.prose pre { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius-xl); background: #f7f7f6; border: 1px solid var(--border); overflow: auto; }
.prose pre code { background: transparent; border: 0; padding: 0; border-radius: 0; font-size: 13px; }

.note { border: 1px solid var(--border); background: #fff; border-radius: var(--radius-lg); padding: 14px 16px; margin: 16px 0; }
.note strong { display: block; margin-bottom: 6px; }

.btn-link { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 14px; font-weight: 800; background: var(--accent); color: var(--accent-foreground); }

/* Guide page Medium-style */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted-foreground); margin: 0 0 14px; }
.breadcrumbs a { color: var(--muted-foreground); text-decoration: none; }
.breadcrumbs a:hover { color: var(--foreground); }
.breadcrumbs .sep { opacity: 0.5; }

.guide-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.guide-chip { font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); letter-spacing: 0.01em; }
.guide-chip.is-soft { background: rgba(0, 117, 222, 0.08); color: var(--accent); }

.guide-promise { font-size: 19px; line-height: 1.45; color: var(--foreground); margin: 12px 0 18px; max-width: 60ch; font-weight: 500; }

.guide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 24px; color: var(--muted-foreground); font-size: 13px; }
.guide-meta .author { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); font-weight: 600; }
.guide-meta .author-avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--muted); overflow: hidden; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.guide-meta .author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.guide-meta .dot { width: 3px; height: 3px; border-radius: 999px; background: var(--muted-foreground); opacity: 0.6; }

/* Optional guide hero banner */
.guide-banner { margin: 8px 0 22px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); background: #0B1220; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.guide-banner-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.guide-hero { margin: 8px 0 22px; border-radius: var(--radius-xl); overflow: hidden; background: linear-gradient(135deg, rgba(0,117,222,0.10) 0%, rgba(0,117,222,0.02) 100%); border: 1px solid var(--border); padding: 32px 26px; display: flex; align-items: center; justify-content: center; min-height: 200px; text-align: center; }
.guide-hero-emoji { font-size: 84px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(0,117,222,0.15)); }
.guide-hero-caption { display: block; margin-top: 12px; font-size: 13px; color: var(--muted-foreground); font-weight: 500; }

.callout { margin: 18px 0; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); margin: 0 0 8px; }
.callout > p:last-child { margin-bottom: 0; }
.callout > p:first-of-type { margin-top: 0; }
.callout.is-tip { background: rgba(0, 117, 222, 0.05); border-color: rgba(0, 117, 222, 0.2); }
.callout.is-tip .callout-title { color: var(--accent); }
.callout.is-warn { background: rgba(229, 72, 77, 0.05); border-color: rgba(229, 72, 77, 0.25); }
.callout.is-warn .callout-title { color: var(--destructive); }
.callout.is-quote { background: var(--guide-card); border-left: 4px solid var(--foreground); font-style: italic; }
.callout.is-quote .callout-title { font-style: normal; }
.callout.is-quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: var(--muted-foreground); }
.callout.is-key { background: linear-gradient(135deg, rgba(0,117,222,0.06) 0%, rgba(0,117,222,0.02) 100%); border-color: rgba(0, 117, 222, 0.2); }

.dialog { margin: 18px 0; padding: 18px; border-radius: var(--radius-lg); background: var(--guide-card); border: 1px solid var(--border); }
.dialog-line { margin: 0 0 10px; padding: 0; }
.dialog-line:last-child { margin-bottom: 0; }
.dialog-line .who { display: inline-block; font-weight: 700; margin-right: 8px; color: var(--accent); min-width: 70px; }
.dialog-line.is-them .who { color: var(--muted-foreground); }
.dialog-line .what { color: var(--foreground); }

.phrase-card { display: block; padding: 14px 16px; margin: 10px 0; border-radius: 12px; background: #fff; border: 1px solid var(--border); font-size: 15px; line-height: 1.5; position: relative; }
.phrase-card::before { content: "💬"; margin-right: 8px; opacity: 0.7; }

.bad-example { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius-lg); background: rgba(229, 72, 77, 0.04); border: 1px solid rgba(229, 72, 77, 0.2); border-left: 4px solid var(--destructive); }
.bad-example::before { content: "❌ Так делает большинство и теряет сделку"; display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--destructive); margin-bottom: 8px; }
.good-example { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius-lg); background: rgba(0, 117, 222, 0.04); border: 1px solid rgba(0, 117, 222, 0.2); border-left: 4px solid var(--accent); }
.good-example::before { content: "✅ Как стоит"; display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 8px; }

.prose ul.check { list-style: none; padding-left: 0; }
.prose ul.check li { position: relative; padding-left: 28px; margin: 8px 0; }
.prose ul.check li::before { content: "✅"; position: absolute; left: 0; top: 0; }

.author-card { display: flex; gap: 16px; align-items: center; margin: 28px 0; padding: 18px 20px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--border); }
.author-card-avatar { width: 56px; height: 56px; border-radius: 999px; background: var(--muted); overflow: hidden; flex: 0 0 auto; border: 1px solid var(--border); }
.author-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card-name { font-weight: 700; margin: 0 0 2px; font-size: 15px; }
.author-card-bio { margin: 0; font-size: 13px; color: var(--muted-foreground); line-height: 1.45; }

.related { margin: 30px 0; }
.related-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); margin: 0 0 12px; }
.related-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 10px; }
.related-item { padding: 14px 16px; border-radius: 12px; background: var(--guide-card); border: 1px solid transparent; display: block; text-decoration: none; color: var(--foreground); transition: border-color 0.15s ease; }
.related-item:hover { border-color: var(--border); opacity: 1; }
.related-item-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.related-item-title { margin: 4px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.prose.is-guide { max-width: 38rem; margin-left: auto; margin-right: auto; }

.faq { margin: 36px 0 24px; }
.faq h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.02em; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; margin: 10px 0; overflow: hidden; transition: border-color 0.15s ease; }
.faq-item[open] { border-color: rgba(0, 117, 222, 0.35); background: rgba(0, 117, 222, 0.02); }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 50px 16px 18px; font-weight: 600; font-size: 15px; color: var(--foreground); position: relative; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 400; color: var(--accent); line-height: 1; transition: transform 0.2s ease; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { background: rgba(0, 117, 222, 0.04); }
.faq-answer { padding: 0 18px 18px; color: var(--muted-foreground); font-size: 15px; line-height: 1.6; }
.faq-answer p { margin: 0; }

.outro-block { margin: 38px 0 24px; padding: 32px 26px; border-radius: var(--radius-xl); background: linear-gradient(135deg, rgba(0,117,222,0.10) 0%, rgba(0,117,222,0.03) 100%); border: 1px solid rgba(0, 117, 222, 0.2); text-align: center; }
.outro-kicker { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px; }
.outro-title { margin: 0 0 12px; font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; color: var(--foreground); }
.outro-text { margin: 0 auto 20px; max-width: 50ch; color: var(--muted-foreground); font-size: 15px; line-height: 1.55; }
.outro-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 14px; background: var(--accent); color: var(--accent-foreground); font-weight: 700; font-size: 15px; text-decoration: none; transition: transform 0.15s ease, opacity 0.15s ease; }
.outro-btn:hover { transform: translateY(-1px); opacity: 1; }

.cta-banner.is-index { max-width: 100%; margin: 18px 0 28px; }
.cta-banner.is-index .cta-banner-img { max-height: 220px; object-fit: cover; object-position: 50% 50%; }

@media (min-width: 768px) {
  .nav { display: flex; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  main { padding-top: 104px; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-hero { padding: 48px 32px; min-height: 240px; }
  .guide-hero-emoji { font-size: 110px; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
