/* Blog styles — the same design tokens, header and footer as the landing page.
   Kept in one file so all four pages stay in sync (CSP allows same-origin CSS). */
:root {
  --ink: #0f1113;
  --paper: #e9eef2;
  --line: #292c31;
  --line-strong: #34383d;
  --muted: #95a0aa;
  --faint: #7c8794;
  --brand: #2f74c9;
  --brand-strong: #215fa6;
  --accent: #c82f3d;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Fira Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; }
.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; }

/* ---- Header / footer: identical to the landing ---- */
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.nav { height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: block; width: 30px; height: 30px; border-radius: 9px; }
.nav-links { display: flex; gap: 28px; color: var(--muted); font-size: 13px; }
.nav-links a:hover { color: #fff; }
.nav-links a[aria-current="page"] { color: var(--paper); }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.nav-login { padding: 10px 15px; border: 1px solid var(--line-strong); border-radius: 9px; color: #dfe7ee; background: rgba(255,255,255,.05); font-size: 13px; font-weight: 750; }
.nav-login:hover { color: #fff; background: rgba(255,255,255,.1); border-color: var(--brand); }
.nav-cta { padding: 10px 15px; color: var(--card); background: var(--brand); border-radius: 9px; font-size: 13px; font-weight: 700; }
.nav-cta:hover { background: var(--brand-strong); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 38px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); margin-top: 60px; }

/* ---- Blog index ---- */
.masthead { padding: 46px 0 30px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; color: #7fb2ec; font: 11px "Fira Code", ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; }
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(200,47,61,.16); }
.masthead h1 { margin: 0 0 16px; font-size: clamp(38px, 6vw, 62px); line-height: .98; letter-spacing: -.04em; font-weight: 700; }
.masthead p { max-width: 58ch; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 34px 0 20px; }
.post-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #141b24; transition: border-color .2s ease, transform .2s ease; }
.post-card:hover { border-color: var(--brand); transform: translateY(-3px); }
.post-cover { aspect-ratio: 16 / 9; background: var(--cover) center / cover no-repeat, #1a2330; }
.post-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 20px; }
.post-meta { display: flex; gap: 10px; color: var(--faint); font: 11px "Fira Code", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.post-card h2 { margin: 0; font-size: 21px; line-height: 1.18; letter-spacing: -.03em; font-weight: 650; }
.post-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.post-more { margin-top: auto; padding-top: 6px; color: #7fb2ec; font-size: 13px; font-weight: 750; }

/* ---- Article ---- */
.article { padding: 34px 0 10px; }
.article-head { width: min(760px, 100%); margin: 0 auto; }
.article-head h1 { margin: 12px 0 16px; font-size: clamp(30px, 4.6vw, 50px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; }
.article-head .lede { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.article-body { width: min(680px, 100%); margin: 0 auto; padding: 8px 0 20px; font-size: 17px; line-height: 1.68; }
.article-body h2 { margin: 40px 0 12px; font-size: clamp(23px, 3vw, 30px); line-height: 1.16; letter-spacing: -.03em; font-weight: 650; }
.article-body h3 { margin: 28px 0 10px; font-size: 19px; line-height: 1.25; font-weight: 650; }
.article-body p { margin: 0 0 16px; color: #cbd5df; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; color: #cbd5df; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--paper); }
.article-body a { color: #7fb2ec; font-weight: 650; }
.article-body a:hover { text-decoration: underline; }
.article-body code { padding: 2px 6px; border-radius: 6px; background: #1a2330; color: #cfe0f2; font: 14px "Fira Code", ui-monospace, monospace; }
.callout { margin: 26px 0; padding: 18px 20px; border: 1px solid #24496b; border-left-width: 3px; border-radius: 12px; background: #16273a; color: #cfdcea; font-size: 16px; line-height: 1.6; }
.callout strong { display: block; margin-bottom: 6px; color: #fff; }
.prompt-sample { margin: 22px 0; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: #141b24; color: #dfe7ee; font: 15px/1.6 "Fira Code", ui-monospace, monospace; white-space: pre-wrap; }
.article-cta { width: min(760px, 100%); margin: 40px auto 0; padding: 26px; border: 1px solid #24496b; border-radius: 18px; background: #16273a; text-align: center; }
.article-cta h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.03em; }
.article-cta p { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.article-cta a { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 10px; color: var(--card); background: var(--brand); font-size: 14px; font-weight: 800; }
.article-cta a:hover { background: var(--brand-strong); }
.article-nav { width: min(760px, 100%); margin: 34px auto 0; }
.article-nav a { color: #7fb2ec; font-size: 14px; font-weight: 700; }

/* ---- Конструктор запроса ---- */
.promptbuilder { width: min(760px, 100%); margin: 40px auto 0; padding: 24px 26px; border: 1px solid #24496b; border-radius: 18px; background: #16273a; }
.promptbuilder h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.03em; font-weight: 700; }
.pb-note { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pb-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.pb-fields label, .pb-focus, .pb-result { display: grid; gap: 6px; }
.pb-fields span, .pb-focus > span, .pb-result > span { color: var(--muted); font-size: 13px; }
.pb input, .pb textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #101923; color: var(--paper); font: 15px/1.5 "Fira Sans", ui-sans-serif, system-ui, sans-serif; resize: vertical; }
.pb input:focus, .pb textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(47,116,201,.25); }
.pb input::placeholder, .pb textarea::placeholder { color: #6f7b88; }
.pb-focus { margin-top: 14px; }
/* Готовый запрос набран моноширинным: это текст, который унесут в чат, и в нём
   важно видеть переносы и лишние пробелы. */
.pb-result { margin-top: 14px; }
.pb-result textarea { background: #0f151c; font: 14px/1.6 "Fira Code", ui-monospace, monospace; }
.pb-copy { margin-top: 14px; padding: 13px 20px; border: 0; border-radius: 10px; color: var(--card); background: var(--brand); font: 700 14px "Fira Sans", ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.pb-copy:hover:not(:disabled) { background: var(--brand-strong); }
.pb-copy:disabled { opacity: .45; cursor: default; }

/* ---- Калькуляторы в статьях ---- */
.calc { margin: 30px 0; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 16px; background: #131a23; }
.calc-title { margin: 0 0 6px; font-size: 18px; line-height: 1.25; font-weight: 700; }
.calc-note { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.calc-fields label { display: grid; gap: 6px; }
.calc-fields span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.calc-fields input { width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #0f151c; color: var(--paper); font: 15px "Fira Code", ui-monospace, monospace; }
.calc-fields input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(47,116,201,.25); }
/* Стрелки числового поля на узком экране съедают половину ширины ввода. */
.calc-fields input::-webkit-outer-spin-button, .calc-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-fields input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.calc-out { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.55; }
.calc-rows { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin: 0; }
.calc-rows dt { color: var(--muted); font-size: 14px; }
.calc-rows dd { margin: 0; color: var(--paper); font: 15px "Fira Code", ui-monospace, monospace; text-align: right; }
.calc-verdict { margin: 14px 0 0; color: #cbd5df; font-size: 15px; line-height: 1.55; }

/* ---- Партнёрский блок в статье ---- */
.article-partners { width: min(760px, 100%); margin: 36px auto 0; display: grid; gap: 10px; }
/* Блок стоит в конце длинной статьи, между двумя крупными синими панелями.
   Без собственного заголовка он читался как служебная сноска и терялся. */
.article-partners h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; font-weight: 700; }
.partners-note { margin: -2px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.partner-card { display: grid; gap: 5px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: #141b24; text-decoration: none; transition: border-color .2s ease, background .2s ease; }
.partner-card:hover { background: #172029; }
.partner-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 2px; }
.partner-go { color: #7fb2ec; font-size: 13px; font-weight: 750; white-space: nowrap; }
.partner-card:hover { border-color: var(--partner-accent, var(--brand)); }
.partner-card strong { color: var(--paper); font-size: 16px; font-weight: 700; }
.partner-summary { color: var(--muted); font-size: 14px; line-height: 1.5; }
.partner-benefit { color: #7fb2ec; font-size: 13px; font-weight: 650; }
/* Маркировка обязана быть читаемой, а не спрятанной мелким серым: за это
   отвечает не вкус, а закон. Поэтому --muted, а не --faint, как у сноски выше:
   на #141b24 это около 6:1 против 4:1. */
.partner-mark { color: var(--muted); font: 11px "Fira Code", ui-monospace, monospace; letter-spacing: .04em; }

/* ---- Разделы ---- */
/* Раздел в кикере — ссылка, но кикер уже целиком набран акцентным цветом,
   поэтому цветом её не выделить: остаётся подчёркивание. */
.kicker a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(127,178,236,.45); }
.kicker a:hover { border-bottom-color: currentColor; }

.topic { padding-top: 14px; }
.topic + .topic { padding-top: 30px; border-top: 1px solid var(--line); }
.topic .posts { padding-top: 20px; }
.topic-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding-top: 20px; }
.topic-head h2 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.topic-head h2 a { color: inherit; text-decoration: none; }
.topic-head h2 a:hover { color: #7fb2ec; }
.topic-head p { flex: 1 1 240px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.topic-count { color: var(--faint); font: 11px "Fira Code", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }

.topic-nav { padding: 12px 0 40px; }
.topic-nav h2 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.02em; font-weight: 700; }
.topic-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.topic-links a { display: flex; flex-direction: column; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #141b24; text-decoration: none; transition: border-color .2s ease; }
.topic-links a:hover { border-color: var(--brand); }
/* Именно --paper: на тёмной странице это цвет ТЕКСТА, а --ink — цвет фона.
   Названия здесь перевёрнуты относительно привычных, и --ink давал почти
   невидимый тёмно-серый на тёмной карточке. */
.topic-links strong { color: var(--paper); font-size: 15px; font-weight: 700; }
.topic-links span { color: var(--muted); font-size: 13px; line-height: 1.45; }

@media (max-width: 900px) {
  .posts { grid-template-columns: 1fr; gap: 16px; }
  .topic-links { grid-template-columns: 1fr; }
  .calc-fields { grid-template-columns: 1fr; }
  .pb-fields { grid-template-columns: 1fr 1fr; }
  .promptbuilder { padding: 18px; }
  .calc { padding: 16px; }
  .topic-head h2 { font-size: 22px; }
  .post-card { flex-direction: row; }
  .post-cover { flex: 0 0 132px; aspect-ratio: auto; }
  .post-body { padding: 16px; }
  .post-card h2 { font-size: 18px; }
  .post-card p { display: none; }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .nav-actions { gap: 6px; }
  .nav-login, .nav-cta { padding: 8px 10px; font-size: 11px; }
  .shell { width: calc(100% - 28px); }
  .masthead { padding: 26px 0 18px; }
  .masthead p { font-size: 15px; }
  .post-card { display: block; }
  .post-cover { aspect-ratio: 16 / 9; }
  .post-card p { display: block; }
  .article-body { font-size: 16px; }
  .prompt-sample { font-size: 13px; padding: 14px; }
  .footer { display: block; line-height: 1.9; }
  .footer span { display: block; }
}
